From b9e07a16e3219a1db14f22c8b365172f7567893f Mon Sep 17 00:00:00 2001 From: gorhill Date: Thu, 9 Apr 2015 07:15:14 -0400 Subject: [PATCH] this fixes https://github.com/chrisaljoudi/uBlock/issues/1219 for Firefox --- platform/firefox/bootstrap.js | 2 +- platform/firefox/chrome.manifest | 2 +- platform/firefox/install.rdf | 2 +- platform/firefox/vapi-background.js | 4 ++-- platform/firefox/vapi-client.js | 2 +- tools/make-firefox-meta.py | 4 ++-- tools/make-firefox.sh | 12 ++++++------ 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/platform/firefox/bootstrap.js b/platform/firefox/bootstrap.js index fec58275d..95c2f1532 100644 --- a/platform/firefox/bootstrap.js +++ b/platform/firefox/bootstrap.js @@ -31,7 +31,7 @@ let bgProcess; let version; -const hostName = 'ublock'; +const hostName = 'ublock0'; const restartListener = { get messageManager() { return Components.classes['@mozilla.org/parentprocessmessagemanager;1'] diff --git a/platform/firefox/chrome.manifest b/platform/firefox/chrome.manifest index 5433b6dca..75781cd6f 100644 --- a/platform/firefox/chrome.manifest +++ b/platform/firefox/chrome.manifest @@ -1 +1 @@ -content ublock ./ +content ublock0 ./ diff --git a/platform/firefox/install.rdf b/platform/firefox/install.rdf index 8ace58455..78b44f0ee 100644 --- a/platform/firefox/install.rdf +++ b/platform/firefox/install.rdf @@ -1,7 +1,7 @@ - {{2b10c1c8-a11f-4bad-fe9c-1c11e82cac42}} + uBlock0@raymondhill.net {version} {name} {description} diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index 35e4b506b..fe8c6e446 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -44,7 +44,7 @@ vAPI.fennec = Services.appinfo.ID === '{aa3c5121-dab2-40e2-81ca-7ea25febc110}'; /******************************************************************************/ vAPI.app = { - name: 'uBlock', + name: 'uBlockâ‚€', version: location.hash.slice(1) }; @@ -1856,7 +1856,7 @@ vAPI.contextMenu.remove = function() { /******************************************************************************/ var optionsObserver = { - addonId: '{2b10c1c8-a11f-4bad-fe9c-1c11e82cac42}', + addonId: 'uBlock0@raymondhill.net', register: function() { Services.obs.addObserver(this, 'addon-options-displayed', false); diff --git a/platform/firefox/vapi-client.js b/platform/firefox/vapi-client.js index 5f37ce23d..b2d5e3460 100644 --- a/platform/firefox/vapi-client.js +++ b/platform/firefox/vapi-client.js @@ -160,7 +160,7 @@ vAPI.messaging = { vAPI.messaging.listeners[message.requestId] = callback; } - sendAsyncMessage('ublock:background', message); + sendAsyncMessage('ublock0:background', message); }, close: function() { delete vAPI.messaging.channels[this.channelName]; diff --git a/tools/make-firefox-meta.py b/tools/make-firefox-meta.py index acf009b7b..284fa96d3 100644 --- a/tools/make-firefox-meta.py +++ b/tools/make-firefox-meta.py @@ -56,13 +56,13 @@ for alpha2 in sorted(os.listdir(source_locale_dir)): chrome_manifest = pj(build_dir, 'chrome.manifest') with open(chrome_manifest, 'at', encoding='utf-8', newline='\n') as f: - f.write(u'\nlocale ublock en ./locale/en/\n') + f.write(u'\nlocale ublock0 en ./locale/en/\n') for alpha2 in language_codes: if alpha2 == 'en': continue - f.write(u'locale ublock ' + alpha2 + ' ./locale/' + alpha2 + '/\n') + f.write(u'locale ublock0 ' + alpha2 + ' ./locale/' + alpha2 + '/\n') rmtree(source_locale_dir) diff --git a/tools/make-firefox.sh b/tools/make-firefox.sh index 221ceffa1..85beb60bc 100755 --- a/tools/make-firefox.sh +++ b/tools/make-firefox.sh @@ -2,9 +2,9 @@ # # This script assumes a linux environment -echo "*** uBlock.firefox: Copying files" +echo "*** uBlock0.firefox: Copying files" -DES=dist/build/uBlock.firefox +DES=dist/build/uBlock0.firefox rm -rf $DES mkdir -p $DES @@ -26,14 +26,14 @@ cp platform/firefox/install.rdf $DES/ cp platform/firefox/*.xul $DES/ cp LICENSE.txt $DES/ -echo "*** uBlock.firefox: Generating meta..." +echo "*** uBlock0.firefox: Generating meta..." python tools/make-firefox-meta.py $DES/ if [ "$1" = all ]; then - echo "*** uBlock.firefox: Creating package..." + echo "*** uBlock0.firefox: Creating package..." pushd $DES/ - zip ../uBlock.firefox.xpi -qr * + zip ../uBlock0.firefox.xpi -qr * popd fi -echo "*** uBlock.firefox: Package done." +echo "*** uBlock0.firefox: Package done."