<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><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">152598</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Feature request: a callback when request is blocked by the Content Blocker
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>WebKit Misc.
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>am&#64;adguard.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Currently it is very hard to debug content blocker rules as we can't discover which rule has been triggered.

The only notification I see in webkit code is:

if (willBlockLoad) {
    if (currentDocument)
        currentDocument-&gt;addConsoleMessage(MessageSource::ContentBlocker,
MessageLevel::Info, makeString(&quot;Content blocker prevented frame displaying
&quot;, mainDocumentURL.string(), &quot; from loading a resource from &quot;,
request.url().string()));
       return BlockedStatus::Blocked;
    }

But clearly that's not enough.

It would be great if there was some kind of a callback method signaling about triggered content blocker rule.

Essential information:
1. Main document URL
2. Request URL
3. Content blocker rule (if it is possible to pass the whole rule here).

If point 3 is too hard to implement, you might add an ID property to the rule syntax and pass that ID back in the callback method.</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>