From f6c889a09da4ca604e0c40e9c2c5ea3fd190a9b2 Mon Sep 17 00:00:00 2001 From: Laurent Espitallier Date: Wed, 9 Aug 2017 20:38:35 +0200 Subject: [PATCH] Manages AMO pages --- background.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/background.js b/background.js index d952459..e2726fa 100644 --- a/background.js +++ b/background.js @@ -55,7 +55,7 @@ browser.contextMenus.create({ onclick: function(){ browser.tabs.query({ currentWindow: true, active: true }, function(tabs) { tab = tabs[0]; - if(tab.url.includes("about:reader?url=") == true){ + if((tab.url.includes("about:reader?url=") == true) || (tab.url.includes("https://addons.mozilla.org/") == true)){ shareURL("",tab); } else @@ -75,7 +75,7 @@ browser.browserAction.onClicked.addListener((tab) => { } else { - browser.tabs.sendMessage(tab.id, {method: "getSelection"}).then(response => { + if((tab.url.includes("about:reader?url=") == true) || (tab.url.includes("https://addons.mozilla.org/") == true)){ shareURL(response.response,tab); }).catch(onError); }