<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [Content Extensions] Content blocking rules are not consulted for pings (&lt;a ping&gt;)"
   href="https://bugs.webkit.org/show_bug.cgi?id=149873#c10">Comment # 10</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [Content Extensions] Content blocking rules are not consulted for pings (&lt;a ping&gt;)"
   href="https://bugs.webkit.org/show_bug.cgi?id=149873">bug 149873</a>
              from <span class="vcard"><a class="email" href="mailto:roop+webkit&#64;roopc.net" title="Roopesh Chander &lt;roop+webkit&#64;roopc.net&gt;"> <span class="fn">Roopesh Chander</span></a>
</span></b>
        <pre>Thanks everyone for the encouraging feedback.

I didn't quite know earlier what the other 2 methods in PingLoader were doing. This is what I understand to be the purpose of the 3 methods:

 1. loadImage(): Loading images in unload / beforeunload / pagehide handlers
 2. sendPing(): Sending &lt;a ping&gt; pings
 3. sendViolationReport(): Sending CSP violation / X-XSS-Protection reports

They all do different things, but they are all in PingLoader because all are fire-and-forget scenarios - we need not bother to wait for the response.

I can see that content blocking rules should be consulted for 1 &amp; 2 definitely. I'm not sure about 3, but I'll submit a new patch that covers all 3 based on Alex's and Benjamin's comments.

(In reply to <a href="show_bug.cgi?id=149873#c8">comment #8</a>)
<span class="quote">&gt; (In reply to <a href="show_bug.cgi?id=149873#c4">comment #4</a>)
&gt; &gt; I don't see how &quot;css-display-none&quot; can apply to pings.
&gt; Making a request to a url (or trying to make a blocked request to a url)
&gt; that matches a css-display-none rule should hide content on the page.  This
&gt; probably already works, but it would be a good test case to add.</span >

I don't understand this part.

Let's say we have a rule like this:

    {
        &quot;trigger&quot;: { &quot;url-filter&quot;: &quot;ping_url&quot; },
        &quot;action&quot;: { &quot;type&quot;: &quot;css-display-none&quot;, &quot;selector&quot;: &quot;.foo&quot; }
    }

Per my understanding, this rule says: When the frame URL matches &quot;ping_url&quot;, add &quot;.foo { display: none }&quot; style to the stylesheet engine.

How would this rule affect any of the three fire-and-forget scenarios mentioned above? There wouldn't be any loaded webpage to apply the &quot;.foo { display: none }&quot; style, right?

Or are we talking about the case where the selector for a &quot;css-display-none&quot; rule is &quot;a[ping='ping_url']&quot;?</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>