aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2021-08-18 20:54:07 +0200
committerWojtek Kosior <koszko@koszko.org>2021-08-18 20:54:07 +0200
commit3d0efa153c95f3bf4912379f910bc59d0fd563c9 (patch)
tree037779008eb9513fc7a4e30b135a769313cc7d43 /build.sh
parent014f2a2f4e2071c35314d67285711f0f4615266b (diff)
downloadbrowser-extension-3d0efa153c95f3bf4912379f910bc59d0fd563c9.tar.gz
browser-extension-3d0efa153c95f3bf4912379f910bc59d0fd563c9.zip
remove unneeded policy-related cosole messages; restore IceCat 60 compatibility
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh19
1 files changed, 17 insertions, 2 deletions
diff --git a/build.sh b/build.sh
index 941ce1e..31f3dec 100755
--- a/build.sh
+++ b/build.sh
@@ -267,9 +267,24 @@ $(map_get EXPORTCODES $FILEKEY)
done
if [ "$BROWSER" = "chromium" ]; then
- echo "window.killtheweb={is_chrome: true, browser: window.chrome};" > $BUILDDIR/exports_init.js
+ cat > $BUILDDIR/exports_init.js <<EOF
+window.killtheweb={is_chrome: true, browser: window.chrome};
+EOF
else
- echo "window.killtheweb={is_mozilla: true, browser: this.browser};" > $BUILDDIR/exports_init.js
+ cat > $BUILDDIR/exports_init.js <<EOF
+/* Polyfill for IceCat 60. */
+String.prototype.matchAll = String.prototype.matchAll || function(regex) {
+ if (regex.flags.search("g") === -1)
+ throw new TypeError("String.prototype.matchAll called with a non-global RegExp argument");
+
+ for (const matches = [];;) {
+ if (matches[matches.push(regex.exec(this)) - 1] === null)
+ return matches.splice(0, matches.length - 1);
+ }
+}
+
+window.killtheweb={is_mozilla: true, browser: this.browser};
+EOF
fi
cp -r copyright licenses/ $BUILDDIR