From 4b9bc8a8e89e3dc074642e504f0207ab92f1fd41 Mon Sep 17 00:00:00 2001 From: Camille Barneaud <1693643+gadcam@users.noreply.github.com> Date: Tue, 26 Dec 2017 23:09:08 +0100 Subject: [PATCH 1/2] Remove edge code (#1959) * Remove edge code in driver.js * Remove edge code in popup.js --- src/drivers/webextension/js/driver.js | 10 +++------- src/drivers/webextension/js/popup.js | 12 +++--------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/drivers/webextension/js/driver.js b/src/drivers/webextension/js/driver.js index 113aefa00..f3453aef5 100644 --- a/src/drivers/webextension/js/driver.js +++ b/src/drivers/webextension/js/driver.js @@ -118,13 +118,9 @@ var callback = tabs => { }) }; -try { - browser.tabs.query({}) - .then(callback) - .catch(error => wappalyzer.log(error, 'driver', 'error')); -} catch ( e ) { - browser.tabs.query({}, callback); -} +browser.tabs.query({}) + .then(callback) + .catch(error => wappalyzer.log(error, 'driver', 'error')); // Capture response headers browser.webRequest.onCompleted.addListener(request => { diff --git a/src/drivers/webextension/js/popup.js b/src/drivers/webextension/js/popup.js index 237dbae7e..377934f97 100644 --- a/src/drivers/webextension/js/popup.js +++ b/src/drivers/webextension/js/popup.js @@ -11,15 +11,9 @@ var func = tabs => { }); }; -try { - // Chrome, Firefox - browser.tabs.query({ active: true, currentWindow: true }) - .then(func) - .catch(console.error); -} catch ( e ) { - // Edge - browser.tabs.query({ active: true, currentWindow: true }, func); -} +browser.tabs.query({ active: true, currentWindow: true }) + .then(func) + .catch(console.error); function replaceDomWhenReady(dom) { if ( /complete|interactive|loaded/.test(document.readyState) ) { From 1fce3cbc6bfd016ddee3c34a065d3d9b156f6491 Mon Sep 17 00:00:00 2001 From: Camille Barneaud <1693643+gadcam@users.noreply.github.com> Date: Wed, 27 Dec 2017 01:22:18 +0100 Subject: [PATCH 2/2] Enable the use of W in Firefox for Android (#1960) --- src/drivers/webextension/js/driver.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/drivers/webextension/js/driver.js b/src/drivers/webextension/js/driver.js index f3453aef5..d9c4234b7 100644 --- a/src/drivers/webextension/js/driver.js +++ b/src/drivers/webextension/js/driver.js @@ -244,10 +244,14 @@ wappalyzer.driver.displayApps = (detected, meta, context) => { icon = 'converted/' + icon.replace(/\.svg$/, '.png'); } - browser.pageAction.setIcon({ - tabId: tab.id, - path: '../images/icons/' + icon - }); + try { + browser.pageAction.setIcon({ + tabId: tab.id, + path: '../images/icons/' + icon + }); + } catch(e) { + // Firefox for Android does not support setIcon see https://bugzilla.mozilla.org/show_bug.cgi?id=1331746 + } found = true; }