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 /js/vapi-background.js | |
parent | decfbd871636adf1ac35049e3c4ef429b019f249 (diff) | |
parent | 387fb6a0f9a96ff684cea262453a7f5b6afcfbb4 (diff) | |
download | ematrix-1aaed92dc30e7d0364d879f0e8fb1e965c9aaa90.tar.lz ematrix-1aaed92dc30e7d0364d879f0e8fb1e965c9aaa90.tar.xz ematrix-1aaed92dc30e7d0364d879f0e8fb1e965c9aaa90.zip |
Merge branch 'appid-guards'
Diffstat (limited to 'js/vapi-background.js')
-rw-r--r-- | js/vapi-background.js | 60 |
1 files changed, 30 insertions, 30 deletions
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; |