diff options
author | Alessio Vanni <vannilla@firemail.cc> | 2019-03-11 02:16:57 +0100 |
---|---|---|
committer | Alessio Vanni <vannilla@firemail.cc> | 2019-03-11 02:16:57 +0100 |
commit | 15e27b8858bf6e46fdf2d62b4f5a0818b1e85d55 (patch) | |
tree | e274dc253ee377e659ceb67bdf32546274a15263 /js | |
parent | decfbd871636adf1ac35049e3c4ef429b019f249 (diff) | |
download | ematrix-15e27b8858bf6e46fdf2d62b4f5a0818b1e85d55.tar.lz ematrix-15e27b8858bf6e46fdf2d62b4f5a0818b1e85d55.tar.xz ematrix-15e27b8858bf6e46fdf2d62b4f5a0818b1e85d55.zip |
Check how to add the button based on the app ID
Unlike checking different versions of Firefox, the features that
Basilisk has over Pale Moon (and viceversa) are better
known and just checking the application ID is enough to understand how
to add the button to the toolbar.
Diffstat (limited to 'js')
-rw-r--r-- | js/vapi-background.js | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/js/vapi-background.js b/js/vapi-background.js index cca47c6..ae933b7 100644 --- a/js/vapi-background.js +++ b/js/vapi-background.js @@ -2362,24 +2362,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,13 +2596,20 @@ 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; } + + // The following guard seems to always be false for Basilisk, so + // the button will always be added using the code from this + // branch. if ( Services.vc.compare(Services.appinfo.platformVersion, '36.0') >= 0 ) { return null; } |