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:
parent
2162fdbf7d
commit
9f2f77dbc1
15
lib/main.js
15
lib/main.js
@ -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");
|
||||||
}
|
}
|
||||||
}())`
|
}())`
|
||||||
}]
|
}]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user