mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
Block blob in Firefox ESR (52)
This commit is contained in:
parent
942d74ce54
commit
9a26baf5c1
2 changed files with 6 additions and 2 deletions
|
@ -16,8 +16,11 @@
|
|||
const logging = require("./logging");
|
||||
const settings = require("./settings");
|
||||
let canMergeHeader = false;
|
||||
let blockBlob = true;
|
||||
browser.runtime.getBrowserInfo().then(function(info){
|
||||
canMergeHeader = parseInt(info.version.replace(/\..+/, ""), 10) > 59;
|
||||
const mainVersion = parseInt(info.version.replace(/\..+/, ""), 10);
|
||||
canMergeHeader = mainVersion > 59;
|
||||
blockBlob = mainVersion < 60;
|
||||
});
|
||||
function setHeader(headers, header){
|
||||
if (canMergeHeader){
|
||||
|
@ -38,9 +41,9 @@
|
|||
}
|
||||
|
||||
scope.init = function(){
|
||||
const cspMatch = "blob: filesystem: *";
|
||||
browser.webRequest.onHeadersReceived.addListener(
|
||||
function(details){
|
||||
const cspMatch = (blockBlob? "": "blob: ") + "filesystem: *";
|
||||
const headers = details.responseHeaders;
|
||||
if (settings.blockDataURLs){
|
||||
logging.verbose("Adding CSP header to", details);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue