Switch to faster and easier to maintain tld.js from nscl.

This commit is contained in:
hackademix 2021-02-13 00:22:23 +01:00
parent 6ae09d3b62
commit b7d1eb8cfc
3 changed files with 15 additions and 6 deletions

View File

@ -63,11 +63,20 @@ fi
XPI_DIR="$BASE/xpi" XPI_DIR="$BASE/xpi"
XPI="$XPI_DIR/noscript-$VER" XPI="$XPI_DIR/noscript-$VER"
LIB="$SRC/lib" LIB="$SRC/lib"
TLD="$BASE/TLD" NSCL_SUBMOD="$BASE/nscl"
NSCL="$SRC/nscl"
NSCL_SRC="$NSCL_SUBMOD/src/nscl"
if [[ "$1" == "nscl" ]]; then
echo "Updating and synchronizing nscl..."
pushd "$NSCL_SUBMOD" && git submodule update --init && git fetch && git merge && popd || exit 1
cp "$NSCL_SRC/common/tld.js" "$NSCL/common/"
cp "$NSCL_SRC/content/patchWindow.js" "$NSCL/content/"
git add "$NSCL" && git commit -m'[nscl] Updated NoScript Common Library inclusions.'
exit
fi
if ! [ $(date -r "$LIB/tld.js" +'%Y%m%d') -ge $(date +'%Y%m%d') -a "$1" != "tld" ] && "$TLD/generate.sh" "$LIB/tld.js"; then if node "$NSCL_SUBMOD/TLD/update.js" "$NSCL/common/tld.js"; then
cp -u "$TLD/tld.js" "$LIB" git add src/lib/tld.js && git commit -m'[nscl] Updated TLDs.'
git add src/lib/tld.js TLD && git commit -m'Updated TLDs.'
fi fi
if ./html5_events/html5_events.pl; then if ./html5_events/html5_events.pl; then

View File

@ -41,7 +41,7 @@
"lib/log.js", "lib/log.js",
"lib/include.js", "lib/include.js",
"lib/punycode.js", "lib/punycode.js",
"lib/tld.js", "nscl/common/tld.js",
"lib/LastListener.js", "lib/LastListener.js",
"lib/Messages.js", "lib/Messages.js",
"lib/CSP.js", "lib/CSP.js",

View File

@ -21,7 +21,7 @@ var UI = (() => {
"/ui/ui.css", "/ui/ui.css",
"/lib/Messages.js", "/lib/Messages.js",
"/lib/punycode.js", "/lib/punycode.js",
"/lib/tld.js", "/nscl/common/tld.js",
"/common/Policy.js", "/common/Policy.js",
]; ];
this.mobile = UA.mobile; this.mobile = UA.mobile;