Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic cosmetic rules are not applied to some iframes #1721

Open
AdamWr opened this issue Jan 26, 2023 · 4 comments
Open

Generic cosmetic rules are not applied to some iframes #1721

AdamWr opened this issue Jan 26, 2023 · 4 comments

Comments

@AdamWr
Copy link
Member

AdamWr commented Jan 26, 2023

It looks like the generic cosmetic rules are not applied if the iframe height/width is less than a certain value.

Steps to reproduce:

  1. Add this rule:
##h1
  1. Go to - https://example.org/
  2. Run in browser console:
(() => {
  const frame = document.createElement('iframe');
  frame.src = 'https://example.com/';
  frame.width = '500px';
  frame.height = '200px';   
  document.body.appendChild(frame);
})();

h1 element with text Example Domain should be hidden by this rule - ##h1, but it doesn't work.
It seems that it works correctly if the value of height is greater than 200, like 201, or width is greater than 500, like 501.

Screenshots

image

image

AdGuard for Windows version 7.12 nightly 10 (build 4171, CL 1.10.189)

@sfionov
Copy link
Member

sfionov commented Jan 26, 2023

@AdamWr For small frames (< 100'000 px) generic CSS rules are not applied, please use domain-specific rules.

This behaviour is old and derived from this issue:
AdguardTeam/AdguardBrowserExtension#223

@AdamWr
Copy link
Member Author

AdamWr commented Jan 26, 2023

I have noticed it in this issue - AdguardTeam/AdguardFilters#141047
Some ads were not blocked by a generic rule in the video player (iframe) with AdGuard for Android (I have already added a specific rule for this iframe).
If it's by design, then fine, I think that it can be closed.

@Alex-302
Copy link
Member

Another case
https://worldinmotionvr.com/bolum/gibi-1-sezon-11-bolum-izle/

XRecorder_22042023_155705.mp4

Maybe it's time to change the restriction? Especially if it was related to the memory capacity of devices that are eight years old.

@AdamWr
Copy link
Member Author

AdamWr commented May 14, 2024

Another case - AdguardTeam/AdguardFilters#178952
We have generic element hiding rules, but these rules are not applied on Android, because iframe is too small.
I can add a rule(s) for specific domain, but the problem is, that in this case address of this iframe is changed often.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants