1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-12-22 04:40:20 +01:00

Added option to ignore APIs

As mentioned in #233
This commit is contained in:
kkapsner 2018-08-24 16:47:27 +02:00
parent 5ced858173
commit da14aaff51
7 changed files with 52 additions and 0 deletions

View File

@ -513,6 +513,16 @@
"message": "Ignorierliste",
"description": ""
},
"ignoredAPIs_title": {
"message": "Ignorierte APIs",
"description": ""
},
"ignoredAPIs_description": {
"message": "Für die ausgewählten APIs werden keinerlei Benachrichtigungen angezeigt.",
"description": ""
},
"ignorelistDomain": {
"message": "verschweige Domain",
"description": ""

View File

@ -513,6 +513,15 @@
"message": "Ignore list",
"description": ""
},
"ignoredAPIs_title": {
"message": "Ignored APIs",
"description": ""
},
"ignoredAPIs_description": {
"message": "No notifications will be displayed for the selected APIs.",
"description": ""
},
"ignorelistDomain": {
"message": "silence domain",
"description": ""

View File

@ -36,6 +36,9 @@
const apiMap = new Map();
scope.show = function showNotification(tabId, url, api){
if (settings.ignoredAPIs[api]){
return;
}
logging.notice("Show notification for tab", tabId);
if (
settings.get("showNotifications", url) &&

View File

@ -182,6 +182,15 @@
name: "ignoreList",
defaultValue: ""
},
{
name: "ignoredAPIs",
defaultValue: {},
keys: [
"canvas",
"audio",
],
defaultKeyValue: false
},
{
name: "showCallingFile",
defaultValue: false

View File

@ -235,6 +235,23 @@
}
]
},
{
"name": "ignoredAPIs",
"displayDependencies": [
{
"showNotifications": [true],
"displayAdvancedSettings": [true]
},
{
"displayBadge": [true],
"displayAdvancedSettings": [true]
},
{
"highlightBrowserAction": ["color", "blink"],
"displayAdvancedSettings": [true]
}
]
},
{
"name": "showCallingFile",
"displayDependencies": {

View File

@ -195,6 +195,9 @@
else {
for (var delta = 0; delta < 20 && i + delta < length; delta += 1){
let notification = notifications[i + delta];
if (settings.ignoredAPIs[notification.api]){
continue;
}
verbose(notification);
notification.url = new URL(notification.url);
domainNotification(

View File

@ -10,6 +10,7 @@ Version 0.5.3:
- added option to control browser action icon on notifications
- added theme for browser action popup
- added badge
- added option to ignore APIs
fixes:
- CSP did not work properly for worker-src