From 350e436c08613804f1f7ecdfae1651f9bc5f077f Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 21 Sep 2019 12:06:57 -0400 Subject: [PATCH] Remove remnants of `chrome` references... ... from platform-independent code. This should complete the de-chromiumification of uBO. Next step will be to swap the content of the `platform/chromium` and `platform/firefox` folders so as to reflect that Firefox is the natural platform for uBO. --- platform/chromium/vapi-client.js | 2 +- platform/chromium/vapi-common.js | 6 +++--- src/js/cachestorage.js | 2 +- src/js/messaging.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/platform/chromium/vapi-client.js b/platform/chromium/vapi-client.js index f20982eb2..6dad8a212 100644 --- a/platform/chromium/vapi-client.js +++ b/platform/chromium/vapi-client.js @@ -174,7 +174,7 @@ vAPI.messaging = { this.portPollerBound = this.portPoller.bind(this); } try { - this.port = chrome.runtime.connect({name: vAPI.sessionId}) || null; + this.port = browser.runtime.connect({name: vAPI.sessionId}) || null; } catch (ex) { this.port = null; } diff --git a/platform/chromium/vapi-common.js b/platform/chromium/vapi-common.js index d8c220ca2..c255b1dd4 100644 --- a/platform/chromium/vapi-common.js +++ b/platform/chromium/vapi-common.js @@ -52,7 +52,7 @@ vAPI.webextFlavor = { soup.add('ublock').add('webext'); // Whether this is a dev build. - if ( /^\d+\.\d+\.\d+\D/.test(chrome.runtime.getManifest().version) ) { + if ( /^\d+\.\d+\.\d+\D/.test(browser.runtime.getManifest().version) ) { soup.add('devbuild'); } @@ -127,11 +127,11 @@ vAPI.download = function(details) { /******************************************************************************/ -vAPI.getURL = chrome.runtime.getURL; +vAPI.getURL = browser.runtime.getURL; /******************************************************************************/ -vAPI.i18n = chrome.i18n.getMessage; +vAPI.i18n = browser.i18n.getMessage; // http://www.w3.org/International/questions/qa-scripts#directions document.body.setAttribute( diff --git a/src/js/cachestorage.js b/src/js/cachestorage.js index 1657ee3ec..c717ccdd4 100644 --- a/src/js/cachestorage.js +++ b/src/js/cachestorage.js @@ -39,7 +39,7 @@ // indexedDB. // https://bugzilla.mozilla.org/show_bug.cgi?id=1371255 -// Firefox-specific: we use indexedDB because chrome.storage.local() has +// Firefox-specific: we use indexedDB because browser.storage.local() has // poor performance in Firefox. // https://github.com/uBlockOrigin/uBlock-issues/issues/328 // Use IndexedDB for Chromium as well, to take advantage of LZ4 diff --git a/src/js/messaging.js b/src/js/messaging.js index a3b786a84..6ff0fc21f 100644 --- a/src/js/messaging.js +++ b/src/js/messaging.js @@ -109,7 +109,7 @@ const onMessage = function(request, sender, callback) { case 'getAppData': response = { - name: chrome.runtime.getManifest().name, + name: browser.runtime.getManifest().name, version: vAPI.app.version }; break;