diff -up noscript-11.4.11/build.sh.f noscript-11.4.11/build.sh
--- noscript-11.4.11/build.sh.f 2022-09-14 15:45:17.000000000 +0200
+++ noscript-11.4.11/build.sh 2022-10-04 14:04:04.620302316 +0200
@@ -70,13 +70,6 @@ LIB="$SRC/lib"
NSCL="$SRC/nscl"
-# install html5_events.pl dependencies if needed
-cpan Regexp::List List::MoreUtils
-if ./html5_events/html5_events.pl; then
- # update full event list as an array in src/lib/DocumentFreezer.js
- EVENTS=$(grep '^on[a-z]\+$' html5_events/html5_events_archive.txt | sed "s/^on//;s/.*/'&'/;H;1h;"'$!d;x;s/\n/, /g');
- perl -pi -e 's/(\bconst eventTypes\s*=\s*)\[.*?\]/$1\['"$EVENTS"'\]/' src/lib/DocumentFreezer.js
-fi
rm -rf "$BUILD" "$XPI"
cp -pR "$SRC" "$BUILD"
@@ -86,8 +79,8 @@ cp -pR "$SRC" "$BUILD"
cp -p LICENSE "$BUILD"/
-BUILD_CMD="web-ext"
-BUILD_OPTS="build --overwrite-dest"
+BUILD_CMD="zip"
+BUILD_OPTS="-r"
CHROMIUM_BUILD_CMD="$BUILD_CMD"
CHROMIUM_BUILD_OPTS="$BUILD_OPTS"
@@ -131,10 +124,43 @@ else
WEBEXT_OUT="$XPI_DIR"
fi
-COMMON_BUILD_OPTS="--ignore-files=test/XSS_test.js --ignore-files=content/experiments.js"
+grep -E -h -v '^(#|$)' .gitignore src/nscl/.gitignore > exclude.lst
+cat >> exclude.lst << __EOF__
+.gitignore
+content/experiments.js
+nscl/boot.js
+nscl/common/Entities.js
+nscl/content/DocumentFreezer.js
+nscl/content/ftp.js
+nscl/content/patchWorkers.js
+nscl/content.js
+nscl/COPYING
+nscl/lib/sha256.js.license
+nscl/lib/browser-polyfill.js.license
+nscl/lib/punycode.js.license
+nscl/LICENSE.md
+nscl/LICENSES/*
+nscl/main.js
+nscl/.reuse/*
+nscl/.gitignore
+nscl/include.sh
+nscl/manifest.json
+nscl/nscl-logo.png
+nscl/reuse.sh
+nscl/ReadMe.md
+nscl/service/patchWorkers.js
+nscl/service/PolicyEnforcer.js
+nscl/service/WebRequestCSP.js
+nscl/test/run.js
+nscl/TLD/*
+test/XSS_test.js
+__EOF__
+COMMON_BUILD_OPTS="--exclude @$BASE/exclude.lst"
build() {
- "$BUILD_CMD" $BUILD_OPTS --source-dir="$WEBEXT_IN" --artifacts-dir="$WEBEXT_OUT" $COMMON_BUILD_OPTS
+ pushd "$WEBEXT_IN"
+ "$BUILD_CMD" $BUILD_OPTS "$WEBEXT_OUT/noscript-$VER.zip" . $COMMON_BUILD_OPTS
+ popd
}
build
@@ -156,6 +182,7 @@ elif ! [ -f "$XPI.xpi" ]; then
exit 3
fi
ln -fs "$XPI.xpi" "$BASE/latest.xpi"
+exit 0
# create Chromium pre-release
diff -up noscript-11.4.11/src/nscl/TLD/update.js.f noscript-11.4.11/src/nscl/TLD/update.js
--- noscript-11.4.11/src/nscl/TLD/update.js.f 2022-08-10 22:43:16.000000000 +0200
+++ noscript-11.4.11/src/nscl/TLD/update.js 2022-10-04 13:56:15.855290126 +0200
@@ -31,13 +31,7 @@ const TLD_OUT = args[0] || "../common/tl
let ts = Date.now();
-https.get(TLD_URL, res => {
- res.pipe(fs.createWriteStream(TLD_CACHE));
- res.on("end", function() {
- console.log(`${TLD_URL} retrieved in ${Date.now() - ts}ms.`);
- parse();
- });
-});
+fs.readFileSync(TLD_CACHE, 'utf8', parse());
function parse() {
let section;