PageAction: init in config, storage and background click listener

This commit is contained in:
ikipatang 2017-11-26 23:24:10 +01:00
parent ff775a9c7d
commit 75b40ece52
3 changed files with 10 additions and 0 deletions

View file

@ -20,5 +20,10 @@
"browser_action": { "browser_action": {
"default_icon": "resources/icons/icon-24.png", "default_icon": "resources/icons/icon-24.png",
"default_title": "Share" "default_title": "Share"
},
"page_action": {
"browser_style": false,
"default_icon": "resources/icons/icon-24.png",
"default_title": "Share"
} }
} }

View file

@ -30,4 +30,8 @@ function shareCurrentTab(tab) {
}); });
} }
/*
Listeners
*/
browser.browserAction.onClicked.addListener(shareCurrentTab); browser.browserAction.onClicked.addListener(shareCurrentTab);
browser.pageAction.onClicked.addListener(shareCurrentTab);

View file

@ -3,6 +3,7 @@ Default settings. Initialize storage to these values.
*/ */
var storage = { var storage = {
url: '', url: '',
pageAction: false,
} }
/* /*