Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc-browser.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarjolintu <sami.vanttinen@protonmail.com>2022-09-23 09:26:27 +0300
committervarjolintu <sami.vanttinen@protonmail.com>2022-09-23 09:26:27 +0300
commitb93565d0dcbe84b282031759ebd4f591c719e67d (patch)
tree008c651d28b5d092bba91374d9f96c0516806160
parent4c1a956cd7074c67823e11d345f991f53085b1c0 (diff)
Wrap browserAction.setIcon and .setAction for Firefoxmanifest_v3
-rwxr-xr-xkeepassxc-browser/background/browserAction.js24
1 files changed, 21 insertions, 3 deletions
diff --git a/keepassxc-browser/background/browserAction.js b/keepassxc-browser/background/browserAction.js
index f757d74..d85d8d5 100755
--- a/keepassxc-browser/background/browserAction.js
+++ b/keepassxc-browser/background/browserAction.js
@@ -9,12 +9,12 @@ browserAction.show = function(tab, popupData) {
page.popupData = popupData;
- browser.action.setIcon({
+ browserAction.setIcon({
path: browserAction.generateIconName(popupData.iconType)
});
if (popupData.popup) {
- browser.action.setPopup({
+ browserAction.setPopup({
tabId: tab.id,
popup: `popups/${popupData.popup}.html`
});
@@ -55,7 +55,7 @@ browserAction.updateIcon = async function(tab, iconType) {
tab = tabs[0];
}
- browser.action.setIcon({
+ browserAction.setIcon({
path: browserAction.generateIconName(iconType)
});
};
@@ -82,3 +82,21 @@ browserAction.ignoreSite = async function(url) {
args: [ url ]
});
};
+
+// Wrapper for V2 (Firefox)
+browserAction.setIcon = function(icon) {
+ if (isFirefox()) {
+ browser.browserAction.setIcon(icon);
+ } else {
+ browser.action.setIcon(icon);
+ }
+};
+
+// Wrapper for V2 (Firefox)
+browserAction.setPopup = function(popup) {
+ if (isFirefox()) {
+ browser.browserAction.setPopup(popup);
+ } else {
+ browser.action.setPopup(popup);
+ }
+};