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

eurointegration.com.ua: ads #166

Closed
dportvine opened this issue Aug 6, 2024 · 16 comments
Closed

eurointegration.com.ua: ads #166

dportvine opened this issue Aug 6, 2024 · 16 comments

Comments

@dportvine
Copy link

Open this link in a new tab https://www.eurointegration.com.ua/news/2024/08/5/7191539/
Wait 10 seconds and click on the tab, the empty space at the top is not hidden. In uBOL i see ads. You need clear cache after reload page.

Google Chrome 127.0.6533.89, uBOL 2024.8.5.925

Video uBOL
Video_2024-08-06_102117.mp4

Also uBlockOrigin/uAssets#24781

@MasterKia MasterKia changed the title eurointegration.com.ua eurointegration.com.ua: ads Aug 6, 2024
@gorhill
Copy link
Member

gorhill commented Aug 6, 2024

Just lowering the filtering mode to Basic/Optimal then back to Complete causes the ads to show up afterward, but then, not always.
Looks like a timing issue, this needs more investigation.


When the following error appears at the console, ads are blocked, if not, ads are not blocked:

image


Possibly related to this filter:

##script[onerror*="error-report.com"]:watch-attr(onerror):remove-attr(onerror)

@stephenhawk8054
Copy link
Member

This site looks like related to ad-shield so there might be some side-effects with the filters related to it.

@gorhill
Copy link
Member

gorhill commented Aug 6, 2024

It's definitely a timing issue, oftentimes the target script won't be found in the DOM, hence its onerror handler can't be removed.

The only way I found to address the issue is to instead use a filter based on ra.js scriptlet, along with some modifications to the scriptlet to allow for "remove attribute asap":

eurointegration.com.ua##+js(ra, onerror, script[onerror*="error-report.com"], asap stay)

When asap is present, the scriptlet will not only find the target element immediately upon injection, but also immediately when the mutation observer is triggered. This results in a much more reliable filtering, though sometimes a placeholder can be left at the top -- possibly addressable with a cosmetic filter.

gorhill added a commit to gorhill/uBlock that referenced this issue Aug 6, 2024
@gorhill
Copy link
Member

gorhill commented Aug 6, 2024

Solution has been to improve ra.js to make it possible to remove attribute without delay when DOM changes are detected, and to add a filter using ra.js as a reliable replacement for the procedural cosmetic filter ##script[onerror*="error-report.com"]:watch-attr(onerror):remove-attr(onerror).

I have verified that I could not reproduce the issue with the new ra.js filter.

@stephenhawk8054
Copy link
Member

cc @JobcenterTycoon

For some ad-shield websites in uBOL

@gorhill
Copy link
Member

gorhill commented Aug 7, 2024

Probably that filter is also more reliable in uBO.

@stephenhawk8054
Copy link
Member

Probably that filter is also more reliable in uBO.

You mean this one?

##+js(ra, onerror, script[onerror*="error-report.com"], asap stay)

@uBlock-user
Copy link

So, ra.js will not be removed eventually into the future ?

@dportvine
Copy link
Author

How can I get a version of uBOL with these latest changes?

@stephenhawk8054
Copy link
Member

You have to build it yourself I think.

@gorhill
Copy link
Member

gorhill commented Aug 7, 2024

So, ra.js will not be removed eventually into the future ?

Can't remove it for now since it's the only one that can reliably remove on... handlers in Firefox, remove-attr() doesn't work because it's executed in isolated world. Now with the improvment here, it has become more reliable for removing on... handlers in any browser since cosmetic procedural filters always execute in a lazy way by design.

@gorhill
Copy link
Member

gorhill commented Aug 7, 2024

How can I get a version of uBOL with these latest changes?

Is eurointegration.com.ua considered a high traffic site? If so, I could release a new version of uBOL.

@dportvine
Copy link
Author

Is eurointegration.com.ua considered a high traffic site? If so, I could release a new version of uBOL.

The problem is only in the new tab, the new version is not needed.

stephenhawk8054 referenced this issue in uBlockOrigin/uAssets Aug 13, 2024
@JobcenterTycoon
Copy link

Changed here uBlockOrigin/uAssets@bc288a8

@stephenhawk8054
Copy link
Member

@JobcenterTycoon I think asap is not available for uBO stable yet, so we might still need :remove-attribute() ?

@JobcenterTycoon
Copy link

Yes sorry i forgot there was a latest scriptlet change.

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

No branches or pull requests

5 participants