Compare commits
1 Commits
main
...
mozilla-mo
Author | SHA1 | Date | |
---|---|---|---|
f87d7da8b8 |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"name": "Cookie Dialog Monster",
|
||||
"name": "Cookie Dialog Monster Mobile",
|
||||
"version": "8.0.5",
|
||||
"default_locale": "en",
|
||||
"description": "__MSG_appDesc__",
|
||||
@ -12,19 +12,18 @@
|
||||
"action": {
|
||||
"default_icon": "assets/icons/off.png",
|
||||
"default_popup": "popup.html",
|
||||
"default_title": "Cookie Dialog Monster"
|
||||
"default_title": "Cookie Dialog Monster Mobile"
|
||||
},
|
||||
"options_page": "options.html",
|
||||
"author": "wanhose",
|
||||
"background": {
|
||||
"scripts": ["scripts/background.js"],
|
||||
"service_worker": "scripts/background.js"
|
||||
"scripts": ["scripts/background.js"]
|
||||
},
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
"id": "{77e2c00b-e173-4604-863d-01645d8d2826}",
|
||||
"id": "{108d0aea-9bbd-4719-a793-0bc73c1d0064}",
|
||||
"strict_min_version": "126.0",
|
||||
"update_url": "https://www.cookie-dialog-monster.com/releases/mozilla/updates.json"
|
||||
"update_url": "https://www.cookie-dialog-monster.com/releases/mozilla-mobile/updates.json"
|
||||
}
|
||||
},
|
||||
"content_scripts": [
|
||||
@ -36,7 +35,7 @@
|
||||
}
|
||||
],
|
||||
"host_permissions": ["http://*/*", "https://*/*"],
|
||||
"permissions": ["contextMenus", "declarativeNetRequest", "scripting", "storage", "webRequest"],
|
||||
"permissions": ["declarativeNetRequest", "scripting", "storage", "webRequest"],
|
||||
"web_accessible_resources": [
|
||||
{
|
||||
"matches": ["http://*/*", "https://*/*"],
|
||||
|
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Cookie Dialog Monster > Exclusion List</title>
|
||||
<title>Cookie Dialog Monster Mobile > Exclusion List</title>
|
||||
<link rel="stylesheet" href="/styles/reset.css" />
|
||||
<link rel="stylesheet" href="/styles/options.css" />
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter" />
|
||||
@ -13,7 +13,7 @@
|
||||
<header>
|
||||
<div>
|
||||
<h1 class="header-title">
|
||||
Cookie Dialog Monster > <span data-i18n="options_exclusionListTitle"></span>
|
||||
Cookie Dialog Monster Mobile > <span data-i18n="options_exclusionListTitle"></span>
|
||||
</h1>
|
||||
</div>
|
||||
</header>
|
||||
|
@ -10,7 +10,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1 class="header-title">Cookie Dialog Monster</h1>
|
||||
<h1 class="header-title">Cookie Dialog Monster Mobile</h1>
|
||||
<div class="header-actions">
|
||||
<button
|
||||
class="header-button"
|
||||
|
@ -49,35 +49,11 @@ class RequestManager {
|
||||
*/
|
||||
const apiUrl = 'https://api.cookie-dialog-monster.com/rest/v6';
|
||||
|
||||
/**
|
||||
* @description Context menu identifier
|
||||
* @type {string}
|
||||
*/
|
||||
const extensionMenuItemId = 'CDM-MENU';
|
||||
|
||||
/**
|
||||
* @description Context menu identifier
|
||||
* @type {string}
|
||||
*/
|
||||
const reportMenuItemId = 'CDM-REPORT';
|
||||
|
||||
/**
|
||||
* @description Request manager instance
|
||||
*/
|
||||
const requestManager = new RequestManager();
|
||||
|
||||
/**
|
||||
* @description Context menu identifier
|
||||
* @type {string}
|
||||
*/
|
||||
const settingsMenuItemId = 'CDM-SETTINGS';
|
||||
|
||||
/**
|
||||
* @description A shortcut for browser.scripting
|
||||
* @type {browser.scripting}
|
||||
*/
|
||||
const script = browser.scripting;
|
||||
|
||||
/**
|
||||
* @description Default value for extension state
|
||||
* @type {ExtensionState}
|
||||
@ -251,22 +227,6 @@ async function updateStore(key, value) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Listen to context menus clicked
|
||||
*/
|
||||
browser.contextMenus.onClicked.addListener((info) => {
|
||||
switch (info.menuItemId) {
|
||||
case reportMenuItemId:
|
||||
browser.action.openPopup();
|
||||
break;
|
||||
case settingsMenuItemId:
|
||||
browser.runtime.openOptionsPage();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @description Listens to messages
|
||||
*/
|
||||
@ -334,38 +294,6 @@ browser.runtime.onMessage.addListener((message, sender, callback) => {
|
||||
* @description Listens to extension installed
|
||||
*/
|
||||
browser.runtime.onInstalled.addListener((details) => {
|
||||
const documentUrlPatterns = browser.runtime.getManifest().content_scripts[0].matches;
|
||||
|
||||
browser.contextMenus.create(
|
||||
{
|
||||
contexts: ['all'],
|
||||
documentUrlPatterns,
|
||||
id: extensionMenuItemId,
|
||||
title: 'Cookie Dialog Monster',
|
||||
},
|
||||
suppressLastError
|
||||
);
|
||||
browser.contextMenus.create(
|
||||
{
|
||||
contexts: ['all'],
|
||||
documentUrlPatterns,
|
||||
id: settingsMenuItemId,
|
||||
parentId: extensionMenuItemId,
|
||||
title: browser.i18n.getMessage('contextMenu_settingsOption'),
|
||||
},
|
||||
suppressLastError
|
||||
);
|
||||
browser.contextMenus.create(
|
||||
{
|
||||
contexts: ['all'],
|
||||
documentUrlPatterns,
|
||||
id: reportMenuItemId,
|
||||
parentId: extensionMenuItemId,
|
||||
title: browser.i18n.getMessage('contextMenu_reportOption'),
|
||||
},
|
||||
suppressLastError
|
||||
);
|
||||
|
||||
if (details.reason === 'update') {
|
||||
refreshData();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user