1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-05-25 09:13:27 +02:00

Secured dynamic content script

This commit is contained in:
kkapsner 2017-12-24 21:54:39 +01:00
parent 2162fdbf7d
commit 9f2f77dbc1

View File

@ -104,13 +104,18 @@
runAt: "document_start", runAt: "document_start",
js: [{ js: [{
code: `(function(){ code: `(function(){
const settings = require("./settings"); if (typeof require !== "undefined"){
const logging = require("./logging"); const settings = require("./settings");
if (settings.init(${JSON.stringify(data)})){ const logging = require("./logging");
logging.message("Initialized settings by dynamic content script."); if (settings.init(${JSON.stringify(data)})){
logging.message("Initialized settings by dynamic content script.");
}
else {
logging.error("Dynamic content script was too late to provide settings.");
}
} }
else { else {
logging.error("Dynamic content script was too late to provide settings."); console.error("[CanvasBlocker] invalid content scripts: require not defined");
} }
}())` }())`
}] }]