mirror of https://github.com/gorhill/uBlock.git
Safari vapi-client.js minor formatting
This commit is contained in:
parent
8341fb2193
commit
3413289646
|
@ -166,7 +166,8 @@
|
||||||
|
|
||||||
try {
|
try {
|
||||||
beforeLoadEvent = new Event("beforeload")
|
beforeLoadEvent = new Event("beforeload")
|
||||||
} catch (ex) {
|
}
|
||||||
|
catch(ex) {
|
||||||
legacyMode = true;
|
legacyMode = true;
|
||||||
beforeLoadEvent = document.createEvent("Event");
|
beforeLoadEvent = document.createEvent("Event");
|
||||||
beforeLoadEvent.initEvent("beforeload");
|
beforeLoadEvent.initEvent("beforeload");
|
||||||
|
@ -233,11 +234,10 @@
|
||||||
var tmpScript = "\
|
var tmpScript = "\
|
||||||
(function() {\
|
(function() {\
|
||||||
var block = function(u, t) {" +
|
var block = function(u, t) {" +
|
||||||
( legacyMode
|
(legacyMode ?
|
||||||
? "var e = document.createEvent('CustomEvent');\
|
"var e = document.createEvent('CustomEvent');\
|
||||||
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 + "',\
|
: "var e = new CustomEvent('" + vAPI.sessionId + "', {bubbles: false, detail: {url: u, type: t}});"
|
||||||
{bubbles: false, detail: {url: u, type: t}});"
|
|
||||||
) +
|
) +
|
||||||
"document.dispatchEvent(e);\
|
"document.dispatchEvent(e);\
|
||||||
return e.detail.url === false;\
|
return e.detail.url === false;\
|
||||||
|
@ -318,4 +318,5 @@ return r;\
|
||||||
};
|
};
|
||||||
self.addEventListener("contextmenu", onContextMenu, true);
|
self.addEventListener("contextmenu", onContextMenu, true);
|
||||||
})(this);
|
})(this);
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue