1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-04 16:47:15 +02:00

Safari: XHR should explicitly fail. Fixes #878

This commit is contained in:
Chris 2015-03-01 21:09:28 -07:00
parent bd0e07bef2
commit 83975124a4

View File

@ -236,7 +236,6 @@ return e.detail.url === false;\
wo = open,\ wo = open,\
xo = XMLHttpRequest.prototype.open,\ xo = XMLHttpRequest.prototype.open,\
img = Image;\ img = Image;\
_noOP = function(){};\
Image = function() {\ Image = function() {\
var x = new img();\ var x = new img();\
Object.defineProperty(x, 'src', {\ Object.defineProperty(x, 'src', {\
@ -252,9 +251,9 @@ return x;\
open = function(u) {\ open = function(u) {\
return block(u, 'popup') ? null : wo.apply(this, arguments);\ return block(u, 'popup') ? null : wo.apply(this, arguments);\
};\ };\
XMLHttpRequest.prototype.open = function(m, u, s) {\ XMLHttpRequest.prototype.open = function(m, u) {\
if(block(u, 'xmlhttprequest')) return {send: _noOP};\ if(block(u, 'xmlhttprequest')) {throw 'InvalidAccessError'; return;}\
else return xo.apply(this, arguments);\ else {xo.apply(this, arguments); return;}\
};"; };";
if(frameId === 0) { if(frameId === 0) {
tmpScript += "\ tmpScript += "\