mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
Secured dynamic content script
This commit is contained in:
parent
2162fdbf7d
commit
9f2f77dbc1
1 changed files with 10 additions and 5 deletions
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…
Add table
Add a link
Reference in a new issue