diff --git a/background.js b/background.js index 9e00242..6ce5073 100644 --- a/background.js +++ b/background.js @@ -55,16 +55,28 @@ browser.contextMenus.create({ onclick: function(){ browser.tabs.query({ currentWindow: true, active: true }, function(tabs) { tab = tabs[0]; + if(tab.url.includes("about:") == true){ + shareURL("",tab); + } + else + { browser.tabs.sendMessage(tab.id, {method: "getSelection"}).then(response => { shareURL(response.response,tab); }).catch(onError); + } }); }, contexts: ["all"] }); browser.browserAction.onClicked.addListener((tab) => { + if(tab.url.includes("about:") == true){ + shareURL("",tab); + } + else + { browser.tabs.sendMessage(tab.id, {method: "getSelection"}).then(response => { shareURL(response.response,tab); }).catch(onError); + } }); diff --git a/manifest.json b/manifest.json index f9eeead..32a70c7 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version" : 2, "name": "Add to (Semantic)Scuttle", - "version" : "0.7.1", + "version" : "0.7.2", "description" : "Add bookmarks to a (Semantic)Scuttle instance, a social bookmarking tool experimenting with tags and collaborative tag descriptions.", "homepage_url" : "https://addons.mozilla.org/fr/firefox/addon/add-to-semantic-scuttle/", "icons" : {