From 23487a643a9c7af799f040b8f3a90981410aa684 Mon Sep 17 00:00:00 2001 From: gorhill Date: Tue, 24 Oct 2017 12:40:58 -0400 Subject: [PATCH] prepend vapi-usercss.js to contentscript.js in extension package --- platform/chromium/manifest.json | 2 +- platform/firefox/frameModule.js | 1 - platform/webext/manifest.json | 1 - tools/make-chromium.sh | 7 +++++++ tools/make-firefox.sh | 7 +++++++ tools/make-webext.sh | 7 +++++++ 6 files changed, 22 insertions(+), 3 deletions(-) diff --git a/platform/chromium/manifest.json b/platform/chromium/manifest.json index e35bd0d00..034114a4e 100644 --- a/platform/chromium/manifest.json +++ b/platform/chromium/manifest.json @@ -38,7 +38,7 @@ "content_scripts": [ { "matches": ["http://*/*", "https://*/*"], - "js": ["js/vapi-client.js", "js/vapi-usercss.js", "js/contentscript.js"], + "js": ["js/vapi-client.js", "js/contentscript.js"], "run_at": "document_start", "all_frames": true }, diff --git a/platform/firefox/frameModule.js b/platform/firefox/frameModule.js index c99da7eeb..03ef0bebd 100644 --- a/platform/firefox/frameModule.js +++ b/platform/firefox/frameModule.js @@ -566,7 +566,6 @@ var contentObserver = { let sandbox = this.initContentScripts(win, true); try { lss(this.contentBaseURI + 'vapi-client.js', sandbox); - lss(this.contentBaseURI + 'vapi-usercss.js', sandbox); lss(this.contentBaseURI + 'contentscript.js', sandbox); } catch (ex) { //console.exception(ex.msg, ex.stack); diff --git a/platform/webext/manifest.json b/platform/webext/manifest.json index c9fd692d3..fe121d7db 100644 --- a/platform/webext/manifest.json +++ b/platform/webext/manifest.json @@ -38,7 +38,6 @@ ], "js":[ "js/vapi-client.js", - "js/vapi-usercss.js", "js/contentscript.js" ], "run_at":"document_start", diff --git a/tools/make-chromium.sh b/tools/make-chromium.sh index bf019146f..b6d9d2aab 100755 --- a/tools/make-chromium.sh +++ b/tools/make-chromium.sh @@ -24,6 +24,13 @@ cp platform/chromium/*.html $DES/ cp platform/chromium/*.json $DES/ cp LICENSE.txt $DES/ +echo "*** uBlock0.chromium: concatenating content scripts" +cat $DES/js/vapi-usercss.js > /tmp/contentscript.js +echo >> /tmp/contentscript.js +grep -v "^'use strict';$" $DES/js/contentscript.js >> /tmp/contentscript.js +mv /tmp/contentscript.js $DES/js/contentscript.js +rm $DES/js/vapi-usercss.js + echo "*** uBlock0.chromium: Generating meta..." python tools/make-chromium-meta.py $DES/ diff --git a/tools/make-firefox.sh b/tools/make-firefox.sh index 32dddba7a..f1b5f5ba6 100755 --- a/tools/make-firefox.sh +++ b/tools/make-firefox.sh @@ -31,6 +31,13 @@ cp platform/firefox/install.rdf $DES/ cp platform/firefox/*.xul $DES/ cp LICENSE.txt $DES/ +echo "*** uBlock0.firefox: concatenating content scripts" +cat $DES/js/vapi-usercss.js > /tmp/contentscript.js +echo >> /tmp/contentscript.js +grep -v "^'use strict';$" $DES/js/contentscript.js >> /tmp/contentscript.js +mv /tmp/contentscript.js $DES/js/contentscript.js +rm $DES/js/vapi-usercss.js + echo "*** uBlock0.firefox: Generating meta..." python tools/make-firefox-meta.py $DES/ diff --git a/tools/make-webext.sh b/tools/make-webext.sh index 4e37a7be6..a1e1b8266 100755 --- a/tools/make-webext.sh +++ b/tools/make-webext.sh @@ -32,6 +32,13 @@ cp platform/webext/vapi-usercss.js $DES/js/ rm $DES/options_ui.html rm $DES/js/options_ui.js +echo "*** uBlock0.webext: concatenating content scripts" +cat $DES/js/vapi-usercss.js > /tmp/contentscript.js +echo >> /tmp/contentscript.js +grep -v "^'use strict';$" $DES/js/contentscript.js >> /tmp/contentscript.js +mv /tmp/contentscript.js $DES/js/contentscript.js +rm $DES/js/vapi-usercss.js + echo "*** uBlock0.webext: Generating meta..." python tools/make-webext-meta.py $DES/