From 1c0dc233a92250d9f1ea4f9376914a91fe90fb2e Mon Sep 17 00:00:00 2001 From: kkapsner Date: Mon, 15 Dec 2014 18:43:47 +0100 Subject: [PATCH] Added preferences to display caller(s) --- canvasblocker.xpi | Bin 22712 -> 23772 bytes data/inject.js | 45 +++++++++++++++++++++++++++++++++------- lib/main.js | 17 +++++++++++++++ locale/de-DE.properties | 11 +++++++++- locale/en-US.properties | 11 +++++++++- package.json | 12 +++++++++++ 6 files changed, 87 insertions(+), 9 deletions(-) diff --git a/canvasblocker.xpi b/canvasblocker.xpi index d00aa0559d04427d1200bd775b06eaae7e026353..6ada0347a7af62e44a3ab1c16ff77db60f3827fd 100644 GIT binary patch delta 6825 zcmbt(XHZnzwsn({EE1d4PqdR1@#*?X@w=NhxdTs79Nv76qYeQHKS>VPpY$p8QVE&!gIsC=(? z^2QJy0LaG#0Pt@|VXj^X8#tWL)84^F|44g*pX4T?`=>iT>5EMkP42wn2!T9O3>M+B zq98;Hcu(XF^YsKn*7^HU?}?JgptzI6*0(1oilO%&tFe@BW^~K>YW1ZbS_q_dMNGZw zY3s|AlcM}|t5d+qh50HFZ<7Qiie=B{l}+dT35nhNClXchN(WGJBA`N_>kC1mo7@NP zt4Q7n4@XNI+U7hdpJXM@8rKspHcPQNsnWvfnzbG2k;gVbJ$zb*`t0F%8WFt~m7+#R zshj?B2z^5zpt!dSomm}*FVXjoQ>OjsD+zF6QfG_!Xi%dmF*4k>UM;Miwm zg?CkW29i8cd^q2=lzinxvmI^j8GX<~h?H$up!)U#|1hf{m8B_-TAKNbl-Bn#hJLVg zpljN62Oamqs{_Ygm*GZZpOdeE<_Vp7!jV~@*wwnc!6{bhoQVwwHSVYQb(X@AkKHvo z#%8KD?90=GvQ{GnWhz?geTnMq3V3fl5{FqNhehX)rBXd%L*`n@}(9rEok=pwqiv_kI`nu=Q099<{Jd%~%M`Rq^u!b3%TM35DBqi@P=nJdmlNIJM z;|1tF?bT@uCls*1!gxkBL6Wus4Eg4T zt++@z?R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GdzvxBwarK|$CTlDW;AdwGd|3_zg<<#hbnOSCk*hrKN07@-TQD2b7I#2 z!4d!L2Wkv2{yUKeo@>sBX|MTLE&_A15&rj6_|I=d5a_{w=nMWOf(u$mV7lu4Yx__O ZO4k4N>3>9x;iYBG)$nid{{a79ueksK diff --git a/data/inject.js b/data/inject.js index a45b194..d479bc6 100644 --- a/data/inject.js +++ b/data/inject.js @@ -2,6 +2,9 @@ (function(){ "use strict"; + var settings = { + showCallingFile: false + }; var blockMode = { getContext: { status: "block", @@ -103,8 +106,8 @@ else { //console.log("asking"); var msg = _(changedFunction.mode.askText); - if (changedFunction.mode.askText === "askForReadoutPermission"){ - var callers = new Error().stack.split('\n'); + if (settings.showCallingFile){ + var callers = new Error().stack.trim().split("\n"); //console.log(callers); var findme = callers.shift(); // Remove us from the stack findme = findme.replace(/(:[0-9]+){1,2}$/, ""); // rm line & column @@ -112,9 +115,15 @@ callers = callers.filter(function(caller){ return caller.search(findme) === -1; }); - msg += "\n\nCaller: " + callers[0]; - // maybe show full stack here if some pref - //msg += "\n\nFull stack: \n" + callers.join('\n'); + msg += "\n\n" + _("sourceOutput") + ": "; + if (settings.showCompleteCallingStack){ + msg += callers.reduce(function(stack, c){ + return stack + "\n\t" + _("stackEntryOutput", parseStackEntry(c)); + }, ""); + } + else{ + msg += _("stackEntryOutput", parseStackEntry(callers[0])); + } } status = window.confirm(msg) ? "allow": "block"; askStatus.alreadyAsked = true; @@ -140,9 +149,26 @@ ); }); + // Stack parsing + function parseStackEntry(entry){ + var m = /@(.*):(\d*):(\d*)$/.exec(entry) || ["", entry, "--", "--"]; + return { + url: m[1], + line: m[2], + column: m[3], + raw: entry + }; + } + // Translation - var _ = function(name){ - return _[name] || name; + var _ = function(name, replace){ + var str = _[name] || name; + if (replace){ + Object.keys(replace).forEach(function(name){ + str = str.replace(new RegExp("{" + name + "}", "g"), replace[name]); + }); + } + return str; }; self.port.on("setTranslation", function(name, translation){ _[name] = translation; @@ -198,4 +224,9 @@ blockMode.getContext.status = "allow"; blockMode.readAPI.status = "allow"; }); + + // settings passthrough + self.port.on("set", function(name, value){ + settings[name] = value; + }); }()); diff --git a/lib/main.js b/lib/main.js index 318e80c..d49e21a 100644 --- a/lib/main.js +++ b/lib/main.js @@ -73,6 +73,16 @@ updateBlackList(); }); + // preferences for injected file + var preferencesForInjected = ["showCallingFile", "showCompleteCallingStack"]; + preferencesForInjected.forEach(function(name){ + preferences.on(name, function(){ + workers.forEach(function(worker){ + worker.port.emit("set", name, prefs[name]); + }); + }); + }); + function checkURL(url){ var url = new URL(url); var mode = "block"; @@ -155,6 +165,13 @@ }); worker.port.emit("setTranslation", "askForPermission", _("askForPermission")); worker.port.emit("setTranslation", "askForReadoutPermission", _("askForReadoutPermission")); + worker.port.emit("setTranslation", "sourceOutput", _("sourceOutput")); + worker.port.emit("setTranslation", "stackEntryOutput", _("stackEntryOutput")); + + preferencesForInjected.forEach(function(name){ + worker.port.emit("set", name, prefs[name]); + }); + checkWorker(worker); }, }); diff --git a/locale/de-DE.properties b/locale/de-DE.properties index 1cf7ed2..0af4d33 100644 --- a/locale/de-DE.properties +++ b/locale/de-DE.properties @@ -19,8 +19,17 @@ blockMode_options.allow everything= alles erlauben askOnlyOnce_title= Nur einmal nachfragen askOnlyOnce_description= Wenn eine Seite öfters versucht, die -API abzurufen, erscheint jedes mal eine Nachfrage. Mit diesem Schalter wird pro Seitenbesuch nur einmal nachgefragt. Bei manchen Seiten kann es trotzdem zu mehrmaligem Nachfragen kommen. +showCallingFile_title= Aufrufende Datei anzeigen +showCallingFile_description= + +showCompleteCallingStack_title= Kompletten Aufrufestack anzeigen +showCompleteCallingStack_description= + allowPDFCanvas_title= in PDFs erlauben allowPDFCanvas_description= Die native pdf.js verwendet um den Inhalt von PDFs anzuzeigen. Wenn dies nicht markiert ist, werden viele Nachfragedialoge erscheinen oder die PDF Ansicht nicht funktionieren. askForPermission= Wollen Sie erlauben? -askForReadoutPermission= Wollen Sie das Auslesen von erlauben? \ No newline at end of file +askForReadoutPermission= Wollen Sie das Auslesen von erlauben? + +sourceOutput= Aufrufende Datei +stackEntryOutput= {url} Zeile {line} Spalte {column} \ No newline at end of file diff --git a/locale/en-US.properties b/locale/en-US.properties index e989787..267cdac 100644 --- a/locale/en-US.properties +++ b/locale/en-US.properties @@ -19,8 +19,17 @@ blockMode_options.allow everything= allow everything askOnlyOnce_title= Ask only once askOnlyOnce_description= If a page tries to access the -API several times a confirm message will appear every time. This switch tries to make only one confirmation. Never the less on some pages there will be more. +showCallingFile_title= Show calling file +showCallingFile_description= + +showCompleteCallingStack_title= Display complete calling stack +showCompleteCallingStack_description= + allowPDFCanvas_title= Allow canvas in PDFs allowPDFCanvas_description= The native pdf.js uses to display the PDF content. If this is unchecked there will lots of annoying ask dialogs or the PDF display will not work. askForPermission= Do you want to allow ? -askForReadoutPermission= Do you want to allow readout? \ No newline at end of file +askForReadoutPermission= Do you want to allow readout? + +sourceOutput= Calling file +stackEntryOutput= {url} line {line} column {column} \ No newline at end of file diff --git a/package.json b/package.json index db6f712..5200844 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,18 @@ "type": "bool", "value": true }, + { + "name": "showCallingFile", + "title": "Display calling file", + "type": "bool", + "value": false + }, + { + "name": "showCompleteCallingStack", + "title": "Display complete calling stack", + "type": "bool", + "value": false + }, { "name": "allowPDFCanvas", "title": "Allow canvas in PDFs",