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
@ -104,6 +104,7 @@
|
|||||||
runAt: "document_start",
|
runAt: "document_start",
|
||||||
js: [{
|
js: [{
|
||||||
code: `(function(){
|
code: `(function(){
|
||||||
|
if (typeof require !== "undefined"){
|
||||||
const settings = require("./settings");
|
const settings = require("./settings");
|
||||||
const logging = require("./logging");
|
const logging = require("./logging");
|
||||||
if (settings.init(${JSON.stringify(data)})){
|
if (settings.init(${JSON.stringify(data)})){
|
||||||
@ -112,6 +113,10 @@
|
|||||||
else {
|
else {
|
||||||
logging.error("Dynamic content script was too late to provide settings.");
|
logging.error("Dynamic content script was too late to provide settings.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.error("[CanvasBlocker] invalid content scripts: require not defined");
|
||||||
|
}
|
||||||
}())`
|
}())`
|
||||||
}]
|
}]
|
||||||
}).then(function(api){
|
}).then(function(api){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user