From 15e27b8858bf6e46fdf2d62b4f5a0818b1e85d55 Mon Sep 17 00:00:00 2001 From: Alessio Vanni Date: Mon, 11 Mar 2019 02:16:57 +0100 Subject: 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. --- js/vapi-background.js | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'js/vapi-background.js') 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; } -- cgit v1.2.3