AdguardBrowserExtension icon indicating copy to clipboard operation
AdguardBrowserExtension copied to clipboard

`$stealth` modifier doesn't work correctly in iframes

Open AdamWr opened this issue 3 years ago • 2 comments

Issue Details

  • AdGuard version:
    • AdGuard v4.0.133
  • Browser and version:
    • Chrome 99.0.4844.74

Steps to reproduce

  1. Enable Stealth mode and Hide Referrer from third parties option
  2. Add this rule to user rules
@@||i.ytimg.com^$stealth,domain=youtube.com
  1. Go to - https://example.org/
  2. Press F12, go to Console pane and run this script to load iframe with YouTube video:
 (() => {
        let video = '<iframe width="560" height="315" src="https://www.youtube.com/embed/Fy2rtb95QhY" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
        let createDiv = document.createElement("div");
        document.body.appendChild(createDiv);
        createDiv.innerHTML = video;
      })();
  1. Go to network pane and search for:
i.ytimg.com
  1. Click on a search result and in Headers tab check referer

Expected Behavior

@@||i.ytimg.com^$stealth,domain=youtube.com should disable stealth mode and referer should shows:

referer: https://www.youtube.com/
Screenshot

image

Actual Behavior

It looks like that $stealth rule is not applied to iframe and referer shows:

referer: https://i.ytimg.com/
Screenshot

image

image

Additional Information

This rule:

@@||i.ytimg.com^$stealth,domain=example.org

causes that stealth mode is disabled in iframe (in this case youtube.com), if I'm not wrong, it's not a correct behavior.

AdamWr avatar Mar 17 '22 20:03 AdamWr

As i understand, $domain modifier only matches by main frame, therefore expected behaviour is not true. @maximtop could you please confirm this?

~~edit: @@||i.ytimg.com^$stealth,subdocument,domain=youtube.com also doesn't stop stealth feature~~

stanislav-atr avatar Jul 06 '22 17:07 stanislav-atr

@stanislav-atr compare please how it behaves in the extension v3.x and in the desktop application

maximtop avatar Jul 07 '22 06:07 maximtop

Seems like this was already resolved in the v4.2

maximtop avatar Aug 25 '23 15:08 maximtop