mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 04:26:35 +02:00
PDF canvas support
This commit is contained in:
parent
3eed0d67d3
commit
f185ad443b
4 changed files with 63 additions and 31 deletions
12
lib/main.js
12
lib/main.js
|
@ -88,6 +88,10 @@ preferences.on("askPermission", function(){
|
|||
}
|
||||
workers.forEach(checkWorker);
|
||||
});
|
||||
preferences.on("allowPDFCanvas", function(){
|
||||
workers.forEach(checkWorker);
|
||||
});
|
||||
|
||||
|
||||
pageMod.PageMod({
|
||||
include: "*",
|
||||
|
@ -100,5 +104,13 @@ pageMod.PageMod({
|
|||
worker.on("detach", function(){
|
||||
detachWorker(this, workers);
|
||||
});
|
||||
worker.port.on("isPDF", function(blocking){
|
||||
if (prefs.allowPDFCanvas){
|
||||
worker.port.emit("unblock");
|
||||
}
|
||||
else {
|
||||
worker.port.emit(blocking, true);
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue