mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-04-18 08:08:28 +02:00
parent
410e92d1b0
commit
d122f90655
@ -2,6 +2,10 @@ setting[pref-name="showNotifications"] {
|
|||||||
border-bottom: 0px transparent none;
|
border-bottom: 0px transparent none;
|
||||||
padding-top: 0.5em;
|
padding-top: 0.5em;
|
||||||
}
|
}
|
||||||
|
setting[pref-name="notificationDisplayTime"]{
|
||||||
|
border-top: 0px transparent none;
|
||||||
|
border-bottom: 0px transparent none;
|
||||||
|
}
|
||||||
setting[pref-name="ignoreList"]{
|
setting[pref-name="ignoreList"]{
|
||||||
border-top: 0px transparent none;
|
border-top: 0px transparent none;
|
||||||
padding-bottom: 0.5em;
|
padding-bottom: 0.5em;
|
||||||
|
@ -24,6 +24,9 @@
|
|||||||
setShow: function(value){
|
setShow: function(value){
|
||||||
prefs.showNotifications = value;
|
prefs.showNotifications = value;
|
||||||
prefService.set("extensions.CanvasBlocker@kkapsner.de.showNotifications", prefs.showNotifications);
|
prefService.set("extensions.CanvasBlocker@kkapsner.de.showNotifications", prefs.showNotifications);
|
||||||
|
},
|
||||||
|
displayTime: function(){
|
||||||
|
return prefs.notificationDisplayTime;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
var URL = require("sdk/url").URL;
|
var URL = require("sdk/url").URL;
|
||||||
const {parseErrorStack} = require("./callingStack");
|
const {parseErrorStack} = require("./callingStack");
|
||||||
|
const {setTimeout, clearTimeout} = require("sdk/timers");
|
||||||
|
|
||||||
var tabUtils = require("sdk/tabs/utils");
|
var tabUtils = require("sdk/tabs/utils");
|
||||||
exports.notify = function({url, errorStack, messageId}, {lists, notificationPref, _, browser, window}){
|
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");
|
var notification = notifyBox.getNotificationWithValue("fake-readout");
|
||||||
if (notification){
|
if (notification){
|
||||||
notification.label = message;
|
notification.label = message;
|
||||||
notification.url = url;
|
clearTimeout(notification.hideTimeout);
|
||||||
notification.domain = domain;
|
|
||||||
notification.callingStackMsg = callingStackMsg;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var buttons = [
|
var buttons = [
|
||||||
@ -116,10 +115,17 @@ exports.notify = function({url, errorStack, messageId}, {lists, notificationPref
|
|||||||
priority,
|
priority,
|
||||||
buttons
|
buttons
|
||||||
);
|
);
|
||||||
notification.url = url;
|
|
||||||
notification.domain = domain;
|
|
||||||
notification.callingStackMsg = callingStackMsg;
|
|
||||||
}
|
}
|
||||||
|
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;
|
return notification;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -55,6 +55,8 @@
|
|||||||
"showCompleteCallingStack_title": "Kompletten Aufrufestack anzeigen",
|
"showCompleteCallingStack_title": "Kompletten Aufrufestack anzeigen",
|
||||||
"showNotifications_description": "Benachrichtigungen anzeigen, wenn der Blockiermodus auf \"Auslese-API vortäuschen\" gesetzt ist.",
|
"showNotifications_description": "Benachrichtigungen anzeigen, wenn der Blockiermodus auf \"Auslese-API vortäuschen\" gesetzt ist.",
|
||||||
"showNotifications_title": "Benachrichtigungen anzeigen",
|
"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",
|
"sourceOutput": "Aufrufende Datei",
|
||||||
"stackEntryOutput": "{url} Zeile {line} Spalte {column}",
|
"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}]",
|
"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",
|
"showCompleteCallingStack_title": "Display complete calling stack",
|
||||||
"showNotifications_description": "Show a notification when the block mode is set to \"fake readout API\".",
|
"showNotifications_description": "Show a notification when the block mode is set to \"fake readout API\".",
|
||||||
"showNotifications_title": "Show notifications",
|
"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",
|
"sourceOutput": "Calling file",
|
||||||
"stackEntryOutput": "{url} line {line} column {column}",
|
"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}]",
|
"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",
|
"type": "bool",
|
||||||
"value": true
|
"value": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "notificationDisplayTime",
|
||||||
|
"title": "notification display time",
|
||||||
|
"type": "integer",
|
||||||
|
"value": 30
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "ignoreList",
|
"name": "ignoreList",
|
||||||
"title": "Ignore list",
|
"title": "Ignore list",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user