summaryrefslogtreecommitdiffstats
path: root/platform/chromium
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--platform/chromium/manifest.json4
-rw-r--r--platform/chromium/webext.js12
2 files changed, 14 insertions, 2 deletions
diff --git a/platform/chromium/manifest.json b/platform/chromium/manifest.json
index 28ceec5..df686a0 100644
--- a/platform/chromium/manifest.json
+++ b/platform/chromium/manifest.json
@@ -30,6 +30,9 @@
},
"toggle-cosmetic-filtering": {
"description": "__MSG_toggleCosmeticFiltering__"
+ },
+ "toggle-javascript": {
+ "description": "__MSG_toggleJavascript__"
}
},
"content_scripts": [
@@ -94,6 +97,7 @@
"open_in_tab": true
},
"permissions": [
+ "alarms",
"contextMenus",
"privacy",
"storage",
diff --git a/platform/chromium/webext.js b/platform/chromium/webext.js
index 851b653..f044649 100644
--- a/platform/chromium/webext.js
+++ b/platform/chromium/webext.js
@@ -19,8 +19,6 @@
Home: https://github.com/gorhill/uBlock
*/
-'use strict';
-
// `webext` is a promisified api of `chrome`. Entries are added as
// the promisification of uBO progress.
@@ -54,6 +52,15 @@ const promisify = function(thisArg, fnName) {
};
const webext = {
+ // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/alarms
+ alarms: {
+ clear: promisifyNoFail(chrome.alarms, 'clear'),
+ clearAll: promisifyNoFail(chrome.alarms, 'clearAll'),
+ create: promisifyNoFail(chrome.alarms, 'create'),
+ get: promisifyNoFail(chrome.alarms, 'get'),
+ getAll: promisifyNoFail(chrome.alarms, 'getAll'),
+ onAlarm: chrome.alarms.onAlarm,
+ },
// https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/browserAction
browserAction: {
setBadgeBackgroundColor: promisifyNoFail(chrome.browserAction, 'setBadgeBackgroundColor'),
@@ -95,6 +102,7 @@ const webext = {
query: promisifyNoFail(chrome.tabs, 'query', tabs => Array.isArray(tabs) ? tabs : []),
reload: promisifyNoFail(chrome.tabs, 'reload'),
remove: promisifyNoFail(chrome.tabs, 'remove'),
+ sendMessage: promisifyNoFail(chrome.tabs, 'sendMessage'),
update: promisifyNoFail(chrome.tabs, 'update', tab => tab instanceof Object ? tab : null),
},
// https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webNavigation