mirror of https://github.com/gorhill/uBlock.git
Fixes #1518
This commit is contained in:
parent
524010db8e
commit
bc11167941
|
@ -239,7 +239,7 @@
|
||||||
}
|
}
|
||||||
document.addEventListener(vAPI.sessionId, function(e) {
|
document.addEventListener(vAPI.sessionId, function(e) {
|
||||||
if(shouldBlockDetailedRequest(e.detail)) {
|
if(shouldBlockDetailedRequest(e.detail)) {
|
||||||
e.detail.url = false;
|
document.body.setAttribute("blocked", "true");
|
||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
var tmpJS = document.createElement("script");
|
var tmpJS = document.createElement("script");
|
||||||
|
@ -251,8 +251,9 @@ var block = function(u, t) {" +
|
||||||
e.initCustomEvent('" + vAPI.sessionId + "', false, false, {url: u, type: t});"
|
e.initCustomEvent('" + vAPI.sessionId + "', false, false, {url: u, type: t});"
|
||||||
: "var e = new CustomEvent('" + vAPI.sessionId + "', {bubbles: false, detail: {url: u, type: t}});"
|
: "var e = new CustomEvent('" + vAPI.sessionId + "', {bubbles: false, detail: {url: u, type: t}});"
|
||||||
) +
|
) +
|
||||||
"document.dispatchEvent(e);\
|
"document.body.setAttribute('blocked', '');\
|
||||||
return e.detail.url === false;\
|
document.dispatchEvent(e);\
|
||||||
|
return !!document.body.getAttribute('blocked');\
|
||||||
},\
|
},\
|
||||||
wo = open,\
|
wo = open,\
|
||||||
xo = XMLHttpRequest.prototype.open,\
|
xo = XMLHttpRequest.prototype.open,\
|
||||||
|
|
Loading…
Reference in New Issue