8.0.4 #226
@ -125,15 +125,6 @@ async function getData() {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @async
|
|
||||||
* @description Disable report context menu option
|
|
||||||
* @returns {Promise<void>}
|
|
||||||
*/
|
|
||||||
async function disableReport() {
|
|
||||||
return browser.contextMenus.update(reportMenuItemId, { enabled: false });
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Get current hostname
|
* @description Get current hostname
|
||||||
* @param {string} url
|
* @param {string} url
|
||||||
@ -288,9 +279,6 @@ browser.runtime.onMessage.addListener((message, sender, callback) => {
|
|||||||
const tabId = sender.tab?.id;
|
const tabId = sender.tab?.id;
|
||||||
|
|
||||||
switch (message.type) {
|
switch (message.type) {
|
||||||
case 'DISABLE_REPORT':
|
|
||||||
if (isPage && tabId !== undefined) disableReport();
|
|
||||||
break;
|
|
||||||
case 'DISABLE_ICON':
|
case 'DISABLE_ICON':
|
||||||
if (isPage && tabId !== undefined) {
|
if (isPage && tabId !== undefined) {
|
||||||
browser.action.setIcon({ path: '/assets/icons/off.png', tabId }, suppressLastError);
|
browser.action.setIcon({ path: '/assets/icons/off.png', tabId }, suppressLastError);
|
||||||
@ -396,13 +384,6 @@ browser.runtime.onStartup.addListener(() => {
|
|||||||
refreshData();
|
refreshData();
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* @description Listen to tab changes
|
|
||||||
*/
|
|
||||||
browser.tabs.onActivated.addListener(() => {
|
|
||||||
disableReport();
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Listen to the moment before a request is made to apply the rules
|
* @description Listen to the moment before a request is made to apply the rules
|
||||||
* @returns {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
|
Loading…
Reference in New Issue
Block a user