use action of MV3

"BrowserAction" looks like it will be deprecated.
This commit is contained in:
buzz-lightsnack-2007 2024-04-27 23:37:29 +08:00
parent a6e7941bcc
commit 550cdc7550
2 changed files with 4 additions and 4 deletions

View file

@ -35,7 +35,7 @@ class BrowserIcon {
return (parameters); return (parameters);
} }
return (chrome.browserAction[`get`.concat(detail)](((parameters) ? format(parameters) : null))); return (chrome.action[`get`.concat(detail)](((parameters) ? format(parameters) : null)));
} }
}; };

View file

@ -23,7 +23,7 @@ class Popup {
}) })
// Set the popup path. // Set the popup path.
chrome.browserAction.setPopup(this.options); chrome.action.setPopup(this.options);
// Set the popup state. // Set the popup state.
this[(this.enabled) ? `enable` : `disable`](); this[(this.enabled) ? `enable` : `disable`]();
@ -39,7 +39,7 @@ class Popup {
show () { show () {
if (this.enabled) { if (this.enabled) {
// Set the options if in case it was previously overwritten. // Set the options if in case it was previously overwritten.
chrome.browserAction.setPopup(this.options); chrome.action.setPopup(this.options);
// Open the pop-up. // Open the pop-up.
chrome.action.openPopup(); chrome.action.openPopup();
@ -72,7 +72,7 @@ class Popup {
options = Object.assign(this.options, options); options = Object.assign(this.options, options);
// Set the options. // Set the options.
chrome.browserAction.setPopup(options); chrome.action.setPopup(options);
} }
} }