<div dir="ltr">As I've never got answered on this list, I've filed a bug report:<div><a href="https://bugs.webkit.org/show_bug.cgi?id=151649">https://bugs.webkit.org/show_bug.cgi?id=151649</a><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">--<br>wbr, Andrey Meshkov<div>skype: aymeshkov<br><div>cell: +7 903 534 9643</div></div></div></div></div>
<br><div class="gmail_quote">2015-11-30 2:46 GMT+03:00 Andrey Meshkov <span dir="ltr"><<a href="mailto:am@adguard.com" target="_blank">am@adguard.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi!</div><div><br></div><div>There is an issue with the way content blockers present blocked requests to the requesters.</div><div><br>Usually (e.g. for all other browsers) when request is blocked by add-on or extension it looks like an error to the page code. For instance, "onerror" is called for XMLHttpRequest and "element.onerror" callback is called for the DOM element if it's load is blocked by the ad blocker.</div><div><br></div><div>This is a common behavior and it's handled by web developers.</div><div><br></div><div>In case of Safari content blocker "onerror" event is not raised and it may seem that request is successful while it is not.</div><div><br></div><div>Here is an example.</div><div><br></div><div>This is a rule blocking access to <span style="font-family:monospace,monospace"><a href="http://visualwebsiteoptimizer.com" target="_blank">visualwebsiteoptimizer.com</a> </span>domain.</div><div>This domain is a known tracker so you can see this rule in all "privacy" related filter lists like EasyPrivacy and such.</div><div><div><font face="monospace, monospace">[</font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">        </span>{</font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">                </span>"trigger": {</font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">                        </span>"url-filter": "^https?://[^.]+\\.?visualwebsiteoptimizer\\.com[/:&?]?",</font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">                        </span>"load-type": [</font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">                                </span>"third-party"</font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">                        </span>]</font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">                </span>},</font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">                </span>"action": {</font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">                        </span>"type": "block"</font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">                </span>}</font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">        </span>}</font></div><div><font face="monospace, monospace">]</font></div></div><div><br></div><div>But it can't be used in Safari because the "silent" blocking breaks entire website which use <span style="font-family:monospace,monospace"><a href="http://visualwebsiteoptimizer.com" target="_blank">visualwebsiteoptimizer.com</a></span>. Examples of such websites: </div><div><a href="http://info.singtel.com" target="_blank">http://info.singtel.com</a></div><div><a href="http://www.harveynorman.com.au" target="_blank">http://www.harveynorman.com.au</a></div><div><br></div><div>Here is a code used by them:</div><div><a href="http://pastebin.com/awYa9s95" target="_blank">http://pastebin.com/awYa9s95</a><br></div><div><br></div><div>As you can see they handle "onerror" callback, but it's not fired in Safari so the "body" element remains hidden.</div><div><br></div><div>Btw, this issue also causes significant delays when ads are blocked on Youtube. They also are waiting for "onerror" callback to fire, but as it is not fired, video does not start until "ontimeout" is fired.</div><br clear="all"><div><div><div dir="ltr">--<br>wbr, Andrey Meshkov</div></div></div>
</div>
</blockquote></div><br></div>