diff options
author | Alessio Vanni <vannilla@firemail.cc> | 2019-04-23 15:08:16 +0200 |
---|---|---|
committer | Alessio Vanni <vannilla@firemail.cc> | 2019-04-23 15:08:16 +0200 |
commit | 1aaed92dc30e7d0364d879f0e8fb1e965c9aaa90 (patch) | |
tree | 06fe784bd92f93621d51f48b6c9837f46ee2284c | |
parent | decfbd871636adf1ac35049e3c4ef429b019f249 (diff) | |
parent | 387fb6a0f9a96ff684cea262453a7f5b6afcfbb4 (diff) | |
download | ematrix-1aaed92dc30e7d0364d879f0e8fb1e965c9aaa90.tar.lz ematrix-1aaed92dc30e7d0364d879f0e8fb1e965c9aaa90.tar.xz ematrix-1aaed92dc30e7d0364d879f0e8fb1e965c9aaa90.zip |
Merge branch 'appid-guards'
-rw-r--r-- | bootstrap.js | 8 | ||||
-rw-r--r-- | frameModule.js | 7 | ||||
-rw-r--r-- | install.rdf | 2 | ||||
-rw-r--r-- | js/vapi-background.js | 60 |
4 files changed, 36 insertions, 41 deletions
diff --git a/bootstrap.js b/bootstrap.js index 6573003..059f2d2 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -138,12 +138,8 @@ function waitForHiddenWindow() { // window for the actual background page (windowless browsers are // also what the webextension implementation in Firefox uses for // background pages). - let { Services } = Cu.import('resource://gre/modules/Services.jsm', null); - if ( Services.vc.compare(Services.appinfo.platformVersion, '27') >= 0 ) { - getWindowlessBrowserFrame(appShell); - } else { - createBgProcess(hiddenDoc); - } + getWindowlessBrowserFrame(appShell); + return true; }; diff --git a/frameModule.js b/frameModule.js index 3f225df..92e4d5d 100644 --- a/frameModule.js +++ b/frameModule.js @@ -76,10 +76,9 @@ var contentObserver = { cpMessageName: hostName + ':shouldLoad', uniqueSandboxId: 1, modernFirefox: - Services.vc.compare(Services.appinfo.platformVersion, '44') > 0 && ( - Services.appinfo.ID === '{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}' || - Services.appinfo.ID === '{ec8030f7-c20a-464f-9b0e-13a3a9e97384}' - ), + (Services.appinfo.ID === '{ec8030f7-c20a-464f-9b0e-13a3a9e97384}' + || Services.appinfo.ID === '{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}') + && Services.vc.compare(Services.appinfo.version, '44') > 0, get componentRegistrar() { return Components.manager.QueryInterface(Ci.nsIComponentRegistrar); diff --git a/install.rdf b/install.rdf index 8b2be97..f4aa33e 100644 --- a/install.rdf +++ b/install.rdf @@ -359,7 +359,7 @@ <targetApplication> <r:Description> <id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</id> - <minVersion>24.0</minVersion> + <minVersion>27.0</minVersion> <maxVersion>56.*</maxVersion> </r:Description> </targetApplication> diff --git a/js/vapi-background.js b/js/vapi-background.js index cca47c6..08a84bc 100644 --- a/js/vapi-background.js +++ b/js/vapi-background.js @@ -48,8 +48,9 @@ const {Services} = Cu.import('resource://gre/modules/Services.jsm', null); var vAPI = self.vAPI = self.vAPI || {}; vAPI.firefox = true; -vAPI.modernFirefox = Services.appinfo.ID === '{ec8030f7-c20a-464f-9b0e-13a3a9e97384}' && - Services.vc.compare(Services.appinfo.platformVersion, '44') > 0; + vAPI.modernFirefox = + Services.appinfo.ID === '{ec8030f7-c20a-464f-9b0e-13a3a9e97384}' + && Services.vc.compare(Services.appinfo.version, '44') > 0; /******************************************************************************/ @@ -2362,24 +2363,16 @@ vAPI.toolbarButton = { /******************************************************************************/ -// Firefox 28 and less - (function() { + // Add toolbar button for not-Basilisk + if (Services.appinfo.ID === "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}") { + return; + } + var tbb = vAPI.toolbarButton; if ( tbb.init !== null ) { return; } - var CustomizableUI = null; - var forceLegacyToolbarButton = vAPI.localStorage.getBool('forceLegacyToolbarButton'); - if ( !forceLegacyToolbarButton ) { - try { - CustomizableUI = Cu.import('resource:///modules/CustomizableUI.jsm', null).CustomizableUI; - } catch (ex) { - } - } - if ( CustomizableUI !== null ) { - return; - } tbb.codePath = 'legacy'; tbb.viewId = tbb.id + '-panel'; @@ -2604,17 +2597,19 @@ vAPI.toolbarButton = { /******************************************************************************/ -// Firefox Australis < 36. - +/* (function() { + // Add toolbar button for Basilisk + if (Services.appinfo.ID !== "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}") { + return; + } + var tbb = vAPI.toolbarButton; if ( tbb.init !== null ) { return; } - if ( Services.vc.compare(Services.appinfo.platformVersion, '36.0') >= 0 ) { - return null; - } - if ( vAPI.localStorage.getBool('forceLegacyToolbarButton') ) { + + if ( Services.vc.compare(Services.appinfo.version, '36.0') >= 0 ) { return null; } var CustomizableUI = null; @@ -2675,7 +2670,7 @@ vAPI.toolbarButton = { CustomizableUI.getWidget(tbb.id).areaType === CustomizableUI.TYPE_MENU_PANEL ); } catch (ex) { - /* noop */ + // noop } }; @@ -2731,25 +2726,30 @@ vAPI.toolbarButton = { cleanupTasks.push(shutdown); }; })(); +*/ /******************************************************************************/ -// Firefox Australis >= 36. - (function() { // It appears that this branch actually works on the latest // Basilisk. Maybe we can simply use this one directly instead of // making checks like it's done now. + + // It was decided to use this branch unconditionally. It's still + // experimental though. + + // Add toolbar button for Basilisk + if (Services.appinfo.ID !== "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}") { + return; + } + var tbb = vAPI.toolbarButton; if ( tbb.init !== null ) { return; } - if ( Services.vc.compare(Services.appinfo.platformVersion, '36.0') < 0 ) { - return null; - } - if ( vAPI.localStorage.getBool('forceLegacyToolbarButton') ) { - return null; - } + // if ( Services.vc.compare(Services.appinfo.version, '36.0') < 0 ) { + // return null; + // } var CustomizableUI = null; try { CustomizableUI = Cu.import('resource:///modules/CustomizableUI.jsm', null).CustomizableUI; |