mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-01-30 23:38:47 +01: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",
|
||||
js: [{
|
||||
code: `(function(){
|
||||
const settings = require("./settings");
|
||||
const logging = require("./logging");
|
||||
if (settings.init(${JSON.stringify(data)})){
|
||||
logging.message("Initialized settings by dynamic content script.");
|
||||
if (typeof require !== "undefined"){
|
||||
const settings = require("./settings");
|
||||
const logging = require("./logging");
|
||||
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 {
|
||||
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