Changes between Version 6 and Version 8 of Ticket #7305


Ignore:
Timestamp:
02/28/2019 06:51:31 PM (10 months ago)
Author:
greiner
Comment:

I've invested a few hours into finding out exactly under what circumstances Chrome doesn't notify us of a frame. I found the culprit, created a minimal example and replaced the reproduction steps in the description with it.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7305

    • Property Sensitive unset
  • Ticket #7305 – Description

    v6 v8  
    33Chrome 71 
    44Adblock Plus 3.4.3 
    5 EasyList and AA enabled 
    65 
    76=== How to reproduce === 
    8 1. Open http://hbx-stage.media.net/ebaumsworld.php?com_aax_test=161 in an incognito tab 
    9 2. Open Adblock Plus DevTools panel 
    10 3. Reload page and repeat until request to http://s2s.adpushup.com/AdWebService/feedback shows up in Network tab 
     71. Add the custom filters `/ad.htm^` and `@@/sub.htm$document` 
     82. Create top.htm, sub.htm and ad.htm and launch static web server (see file contents below) 
     93. Open top.htm (e.g. http://localhost:8080/top.htm) 
     10 
     11=== Example file contents === 
     12 
     13**top.htm** 
     14{{{ 
     15<iframe src="sub.htm" height="500"></iframe> 
     16}}} 
     17 
     18**sub.htm** 
     19{{{ 
     20<strong>With srcdoc</strong> 
     21<iframe srcdoc=""></iframe> 
     22 
     23<strong>Without srcdoc</strong> 
     24<iframe></iframe> 
     25 
     26<script> 
     27let iframes = document.querySelectorAll("iframe"); 
     28for (let iframe of iframes) { 
     29  iframe.contentDocument.write(` 
     30    <iframe src="ad.htm"></iframe> 
     31  `); 
     32} 
     33</script> 
     34}}} 
     35 
     36**ad.htm** 
     37{{{ 
     38<script> 
     39document.write("ADVERTISEMENT"); 
     40</script> 
     41}}} 
    1142 
    1243=== Observed behavior === 
    13 - Request to http://s2s.adpushup.com/AdWebService/feedback is blocked by filter `||adpushup.com^$third-party` 
    14 - No ad is shown in on page 
     44- Frame under heading "With srcdoc" failed to load 
     45- Frame under heading "Without srcdoc" loads successfully 
     46- Request to ad.htm is shown in DevTools as being blocked by filter `/ad.htm^` 
    1547 
    1648=== Expected behavior === 
    17 - Request to http://s2s.adpushup.com/AdWebService/feedback is not blocked (doesn't show up in list due to one of its parent frames being whitelisted by `@@http://$document,sitekey=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAMLlOP3Rke738aeqtDCGp0IgSY5XBv7c+brDMmurbYvOFgakGw6sUG8fwt6VkjnOX9s9Kba1Drg2M9Bye/F3x7MCAwEAAQ` filter) 
    18 - Ad is shown on page 
     49- Both frames load successefully 
     50- Request to ad.htm is not shown in DevTools as being blocked 
    1951 
    2052=== What to change === 
     
    2456 
    2557=== Further information === 
    26 The given example page includes an AAX iFrame whose entire content is supposed to be whitelisted using a `$sitekey` filter. Inside this frame the ad is served and rendered using third-party ad code. 
    27  
    28 Ticket is set to confidential because AAX requested to keep example URL private and I'm not aware of any other URLs where this issue occurs. 
    29  
    30 Logging out the first parameter (frame ID) in `updatePageFrameStructure()` in ext/background.js leads to the below results. 
    31  
    32 **master** (i.e. only frame IDs encountered by frame requests) 
    33 0 
    34 1460 
    35 1461 
    36 1462 
    37 1463 
    38 1465 
    39  
    40 **proposed change** 
    41 0 
    42 -1 
    43 1460 
    44 1461 
    45 1462 
    46 1463 
    47 1464 
    48 1465 
    49 1466 
    50  
    51 There was also an issue with `onHeadersReceived` not notifying us of all frame requests when `types: ["main_frame", "sub_frame"]` option is specified but I wasn't able to reproduce it again when coming back to it. If this issue still persists, this may be an additional optimization to avoid adding frames to the hierarchy within `onBeforeRequest` where performance is critical. 
     58Chrome doesn't notify us of the anonymous frame with the srcdoc attribute. Therefore the extension doesn't know which frame the ad.htm request originated from. Due to that the exception rule is not applied and the request gets blocked.