1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-06-05 12:57:50 +02:00

Remove all traces of the addon in the displayed calling stack.

This commit is contained in:
kkapsner 2018-07-17 12:50:40 +02:00
parent bb4f43ec6d
commit 1f5f5bccc4

View File

@ -59,17 +59,12 @@
}
// parse calling stack
const extensionID = browser.extension.getURL("");
function parseErrorStack(errorStack){
var callers = errorStack.trim().split("\n");
var findme = callers.shift(); // Remove us from the stack
findme = findme.replace(/(:[0-9]+){1,2}$/, ""); // rm line & column
// Eliminate squashed stack. stack may contain 2+ stacks, but why...
var inDoubleStack = false;
callers = callers.filter(function(caller){
var doubleStackStart = caller.search(findme) !== -1;
inDoubleStack = inDoubleStack || doubleStackStart;
return !inDoubleStack;
}).map(parseStackEntry);
callers = callers.map(parseStackEntry).filter(function(caller){
return !caller.url.startsWith(extensionID);
});
return {
toString: function(translateAPI){
var msg = "";