-
Notifications
You must be signed in to change notification settings - Fork 30
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
Fix 'prevent-fetch', 'prevent-xhr' — error on blocked request #334
Comments
Not sure if |
If I'm not wrong the problem is in this line: Scriptlets/src/scriptlets/prevent-fetch.js Line 148 in e7295bd
It tries to fetch a content, but request is blocked. Simple test case:
||example.org^$xmlhttprequest
example.org#%#//scriptlet('prevent-fetch', '/')
Code:new Promise((resolve, reject) => {
return fetch('/').then(response => {
if (response.ok) {
console.log('OK test');
resolve(response)
} else {
reject(new Error('error'))
}
}, error => {
reject(new Error(error.message))
})
}) There should message in the console |
Squashed commit of the following: commit e055b3e Author: Adam Wróblewski <adam@adguard.com> Date: Wed Jun 28 18:46:48 2023 +0200 Add test with response.url commit 4cea127 Author: Slava Leleka <v.leleka@adguard.com> Date: Wed Jun 28 19:30:41 2023 +0300 Update a comment commit e054ab2 Author: Slava Leleka <v.leleka@adguard.com> Date: Wed Jun 28 19:29:15 2023 +0300 Update changelog commit 7d43e43 Author: Slava Leleka <v.leleka@adguard.com> Date: Wed Jun 28 19:28:45 2023 +0300 Add a comment with link to issue commit 252040b Author: Adam Wróblewski <adam@adguard.com> Date: Wed Jun 28 17:05:51 2023 +0200 Update changelog commit b0a4bc3 Author: Adam Wróblewski <adam@adguard.com> Date: Wed Jun 28 17:00:06 2023 +0200 Fix issue with prevent-fetch and prevent-xhr
Another problem: |
According to my tests, it should be fixed with latest changes. |
Yes, works fine with dev build. |
The main problem - now this scriplet does not help if a request/domain is blocked by DNS filtering.
Affected more than 300 rules.
Steps to reproduce
yext-pixel.com
to user rules.https://clinics.vippetcare.com/al/birmingham/1928-montgomery-hwy./db089214-36a7-45a8-8f4e-6a14d7c5f17c
View Pricing
button=> It does not work, because
yext-pixel.com
is blocked (in my case - by DNS).vippetcare.com#%#//scriptlet('prevent-fetch', 'www.yext-pixel.com')
Actual behavior
Scripltetdoes not intercept
fetch
request, and the button does not work.Expected behavior
The rule must work like in 4.1.55, where no request when added that rule, and the button is not broken because of blocking request.
The text was updated successfully, but these errors were encountered: