From 550cdc755020c2c3773ba80efea8d264250d72cb Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Sat, 27 Apr 2024 23:37:29 +0800 Subject: [PATCH] use action of MV3 "BrowserAction" looks like it will be deprecated. --- scripts/GUI/extensionIcon.js | 2 +- scripts/GUI/popup.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/GUI/extensionIcon.js b/scripts/GUI/extensionIcon.js index 3335aa0..f0f5932 100644 --- a/scripts/GUI/extensionIcon.js +++ b/scripts/GUI/extensionIcon.js @@ -35,7 +35,7 @@ class BrowserIcon { return (parameters); } - return (chrome.browserAction[`get`.concat(detail)](((parameters) ? format(parameters) : null))); + return (chrome.action[`get`.concat(detail)](((parameters) ? format(parameters) : null))); } }; diff --git a/scripts/GUI/popup.js b/scripts/GUI/popup.js index 4ea7cbf..bcdcaa6 100644 --- a/scripts/GUI/popup.js +++ b/scripts/GUI/popup.js @@ -23,7 +23,7 @@ class Popup { }) // Set the popup path. - chrome.browserAction.setPopup(this.options); + chrome.action.setPopup(this.options); // Set the popup state. this[(this.enabled) ? `enable` : `disable`](); @@ -39,7 +39,7 @@ class Popup { show () { if (this.enabled) { // Set the options if in case it was previously overwritten. - chrome.browserAction.setPopup(this.options); + chrome.action.setPopup(this.options); // Open the pop-up. chrome.action.openPopup(); @@ -72,7 +72,7 @@ class Popup { options = Object.assign(this.options, options); // Set the options. - chrome.browserAction.setPopup(options); + chrome.action.setPopup(options); } }