<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Feature request: a callback when request is blocked by the Content Blocker"
href="https://bugs.webkit.org/show_bug.cgi?id=152598#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Feature request: a callback when request is blocked by the Content Blocker"
href="https://bugs.webkit.org/show_bug.cgi?id=152598">bug 152598</a>
from <span class="vcard"><a class="email" href="mailto:am@adguard.com" title="Andrey Meshkov <am@adguard.com>"> <span class="fn">Andrey Meshkov</span></a>
</span></b>
<pre>The main problem with console log is that we cannot access it from the extension (here I mean both OS X and iOS).
The requested feature will allow us to make quite a few very useful improvements:
1. We can show user a number of blocked items
2. We can show user the list of blocked items (lots of users are interested in what was really blocked on the page)
3. If point 3 is implemented, we can provide a simple rules creation/debugging tool. Just look at how it works in our extension for other browsers:
List of requests:
<a href="http://screencast.com/t/5WKw2E8T63">http://screencast.com/t/5WKw2E8T63</a>
Request details:
<a href="http://screencast.com/t/TXrSoUlx">http://screencast.com/t/TXrSoUlx</a>
<span class="quote">> What kind of callback do you have in mind? We don't have access to much more than the current document here.</span >
You could provide an additional parameter in setContentBlocker method, allowing us to pass a callback method there. I see that in that place where you write the console message, you have access to all request parameters and main document URL, which is a lot already.
Ideally, I'd like to see the following parameters sent to the callback method:
1. Request URL
2. Referrer URL
3. Requested resource type
3. Main document URL
4. Some kind of a tab/window ID. This would be really handy in OS X as we'll be able to distinguish requests by tabs.
5. Content blocker rule (or it's ID if you'll implement it).
One more important notice on this. It will be better to have this callback method called on every request, not just when it's blocked.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>