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

Use redirection resources in 'prevent-xhr' scriptlet #2772

Closed
8 tasks done
piquark6046 opened this issue Aug 10, 2023 · 6 comments
Closed
8 tasks done

Use redirection resources in 'prevent-xhr' scriptlet #2772

piquark6046 opened this issue Aug 10, 2023 · 6 comments
Labels
enhancement New feature or request fixed issue has been addressed

Comments

@piquark6046
Copy link
Member

piquark6046 commented Aug 10, 2023

Prerequisites

  • I verified that this is not a filter list issue. Report any issues with filter lists or broken website functionality in the uAssets issue tracker.
  • This is not a support issue or a question. For support, questions, or help, visit /r/uBlockOrigin.
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue.
  • The issue is not present after disabling uBO in the browser.
  • I checked the documentation to understand that the issue I am reporting is not normal behavior.

I tried to reproduce the issue when...

  • uBO is the only extension.
  • uBO uses default lists and settings.
  • using a new, unmodified browser profile.

Description

Screenshot from 2023-08-10 16-51-08

They checks that google-adsense or googlesyndication exists in XMLHttpRequest.prototype.responseText via jQuery.ajax.done.
It can be resolved if a filters list maintainer can use redirection resources in 'prevent-xhr' scriptlet.

A specific URL where the issue occurs.

https://aagag.com/issue/?idx=1275471

Steps to Reproduce

Pleas visit the website.
If you use List-KR filters list or uAssets filters lists, please apply the following filters:

@@||pagead2.googlesyndication.com/pagead/js/adsbygoogle.js$xhr,from=aagag.com,badfilter
||pagead2.googlesyndication.com/pagead/js/adsbygoogle.js$xhr,redirect-rule=googlesyndication_adsbygoogle.js:5,from=~zipextractor.app,badfilter
||pagead2.googlesyndication.com^$xhr,redirect-rule=noop.js,badfilter

Expected behavior

XMLHttpRequest.prototype.responseText (jQuery.ajax.done) returns googlesyndication_adsbygoogle.js redirection resource.

Actual behavior

XMLHttpRequest.prototype.responseText (jQuery.ajax.done) returns empty text.

uBO version

1.51.0

Browser name and version

Mozilla Firefox Developer Edition 117.0b5

Operating System and version

Ubuntu 23.04

@gwarser gwarser added the enhancement New feature or request label Aug 10, 2023
@gorhill
Copy link
Member

gorhill commented Aug 10, 2023

I want to understand why you would want to use prevent-xhr instead of using redirect filter option?

@piquark6046
Copy link
Member Author

For AdGuard filters list compatibility.
In AdGuard for iOS, $redirect filter option cannot be used if you want to block an anti-adblock script using XMLHttpRequest, element source loading with onerror listeners or fetch.

@gorhill
Copy link
Member

gorhill commented Aug 14, 2023

Meant to use the issue here as reference in commit message: gorhill/uBlock@bf591d93fb

@uBlock-user uBlock-user added the fixed issue has been addressed label Aug 14, 2023
@stephenhawk8054
Copy link
Member

stephenhawk8054 commented Aug 24, 2023

@gorhill Not sure if I should open another issue, but can this be done with fetch too?


Linking with this discussion uBlockOrigin/uAssets@cf9f577 about redirect not work well with Firefox in fetch case as it's hard to search back comments in commits.

For cases that redirect can't work in Firefox, no-fetch-if with war would be helpful.

@gorhill
Copy link
Member

gorhill commented Aug 24, 2023

There is already an issue opened for this: #2526.

@stephenhawk8054
Copy link
Member

stephenhawk8054 commented Aug 24, 2023

Ah right sorry, I misread the title of that issue and overlooked it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

5 participants