mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-01-03 10:31:54 +01:00
parent
410e92d1b0
commit
d122f90655
@ -2,6 +2,10 @@ setting[pref-name="showNotifications"] {
|
||||
border-bottom: 0px transparent none;
|
||||
padding-top: 0.5em;
|
||||
}
|
||||
setting[pref-name="notificationDisplayTime"]{
|
||||
border-top: 0px transparent none;
|
||||
border-bottom: 0px transparent none;
|
||||
}
|
||||
setting[pref-name="ignoreList"]{
|
||||
border-top: 0px transparent none;
|
||||
padding-bottom: 0.5em;
|
||||
|
@ -24,6 +24,9 @@
|
||||
setShow: function(value){
|
||||
prefs.showNotifications = value;
|
||||
prefService.set("extensions.CanvasBlocker@kkapsner.de.showNotifications", prefs.showNotifications);
|
||||
},
|
||||
displayTime: function(){
|
||||
return prefs.notificationDisplayTime;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
var URL = require("sdk/url").URL;
|
||||
const {parseErrorStack} = require("./callingStack");
|
||||
const {setTimeout, clearTimeout} = require("sdk/timers");
|
||||
|
||||
var tabUtils = require("sdk/tabs/utils");
|
||||
exports.notify = function({url, errorStack, messageId}, {lists, notificationPref, _, browser, window}){
|
||||
@ -35,9 +36,7 @@ exports.notify = function({url, errorStack, messageId}, {lists, notificationPref
|
||||
var notification = notifyBox.getNotificationWithValue("fake-readout");
|
||||
if (notification){
|
||||
notification.label = message;
|
||||
notification.url = url;
|
||||
notification.domain = domain;
|
||||
notification.callingStackMsg = callingStackMsg;
|
||||
clearTimeout(notification.hideTimeout);
|
||||
}
|
||||
else {
|
||||
var buttons = [
|
||||
@ -116,10 +115,17 @@ exports.notify = function({url, errorStack, messageId}, {lists, notificationPref
|
||||
priority,
|
||||
buttons
|
||||
);
|
||||
}
|
||||
notification.url = url;
|
||||
notification.domain = domain;
|
||||
notification.callingStackMsg = callingStackMsg;
|
||||
var displayTime = notificationPref.displayTime();
|
||||
if (displayTime){
|
||||
notification.hideTimeout = setTimeout(function(){
|
||||
notification.close();
|
||||
}, displayTime * 1000);
|
||||
}
|
||||
|
||||
return notification;
|
||||
}
|
||||
};
|
||||
|
@ -55,6 +55,8 @@
|
||||
"showCompleteCallingStack_title": "Kompletten Aufrufestack anzeigen",
|
||||
"showNotifications_description": "Benachrichtigungen anzeigen, wenn der Blockiermodus auf \"Auslese-API vortäuschen\" gesetzt ist.",
|
||||
"showNotifications_title": "Benachrichtigungen anzeigen",
|
||||
"notificationDisplayTime_description": "Anzahl Sekunden, die die Benachrichtigungen anzeigen werdne sollen. (Null eingeben, um die Benachrichtigungen nicht automatisch zu schließen.)",
|
||||
"notificationDisplayTime_title": "Benachrichtigungsanzeigezeit",
|
||||
"sourceOutput": "Aufrufende Datei",
|
||||
"stackEntryOutput": "{url} Zeile {line} Spalte {column}",
|
||||
"stackList_description": "JS-Dateien, die die <canvas>-API verwenden dürfen. Die Angabe muss hier im JSON-Format vorliegen. Beispiel: [{\"url\": \"http://domain/datei1.js\"}, {\"url\": \"http://domain/datei2.js\", \"line\": 1, \"column\": 4, \"stackPosition\": -3}]",
|
||||
|
@ -55,6 +55,8 @@
|
||||
"showCompleteCallingStack_title": "Display complete calling stack",
|
||||
"showNotifications_description": "Show a notification when the block mode is set to \"fake readout API\".",
|
||||
"showNotifications_title": "Show notifications",
|
||||
"notificationDisplayTime_description": "Number of seconds the notifications are shown. (Enter zero to disable automatic closing.)",
|
||||
"notificationDisplayTime_title": "Notification display time",
|
||||
"sourceOutput": "Calling file",
|
||||
"stackEntryOutput": "{url} line {line} column {column}",
|
||||
"stackList_description": "JS files which are allowed to use the <canvas>-API. The input has to be in JSON format. Example: [{\"url\": \"http://domain/file1.js\"}, {\"url\": \"http://domain/file2.js\", \"line\": 1, \"column\": 4, \"stackPosition\": -3}]",
|
||||
|
@ -100,6 +100,12 @@
|
||||
"type": "bool",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"name": "notificationDisplayTime",
|
||||
"title": "notification display time",
|
||||
"type": "integer",
|
||||
"value": 30
|
||||
},
|
||||
{
|
||||
"name": "ignoreList",
|
||||
"title": "Ignore list",
|
||||
|
Loading…
x
Reference in New Issue
Block a user