From 75b40ece5235e08ffef3ae136ea8ea522b5fb7e1 Mon Sep 17 00:00:00 2001 From: ikipatang <5412352+ikipatang@users.noreply.github.com> Date: Sun, 26 Nov 2017 23:24:10 +0100 Subject: [PATCH] PageAction: init in config, storage and background click listener --- manifest.json | 5 +++++ src/background.js | 4 ++++ src/storage.js | 1 + 3 files changed, 10 insertions(+) diff --git a/manifest.json b/manifest.json index b70501c..0eb1e34 100644 --- a/manifest.json +++ b/manifest.json @@ -20,5 +20,10 @@ "browser_action": { "default_icon": "resources/icons/icon-24.png", "default_title": "Share" + }, + "page_action": { + "browser_style": false, + "default_icon": "resources/icons/icon-24.png", + "default_title": "Share" } } diff --git a/src/background.js b/src/background.js index e9e3b61..4ec9323 100644 --- a/src/background.js +++ b/src/background.js @@ -30,4 +30,8 @@ function shareCurrentTab(tab) { }); } +/* +Listeners + */ browser.browserAction.onClicked.addListener(shareCurrentTab); +browser.pageAction.onClicked.addListener(shareCurrentTab); diff --git a/src/storage.js b/src/storage.js index 942fd9b..238a76a 100644 --- a/src/storage.js +++ b/src/storage.js @@ -3,6 +3,7 @@ Default settings. Initialize storage to these values. */ var storage = { url: '', + pageAction: false, } /*