-
Notifications
You must be signed in to change notification settings - Fork 82
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
'XMLHttpRequest.prototype.getResponseHeader()' issue in scriptlet and redirect #2518
Comments
Similar: uBlockOrigin/uAssets#16430 (comment) |
Probably because on Firefox Also, please transcribe here the filter to use for your repro case. |
Added into |
I get exceptions being raised. Probably should move your |
A redirect only loads a specific resource, nothing else, thats always been the case with any redirect and not limited to xhr only. |
I want to go through repro steps, but your test case has an issue, your script references elements in the DOM which may not be there yet. If you move your script tag at the end of the body, the repro case will work without throwing an exception. |
Fixed. |
Similar (the site uses let src = '[Some URL]';
const controller = new AbortController();
const timeout = setTimeout(() => controller.abort(), 10_000);
let response;
try {
response = await fetch(src, {signal: controller.signal});
}
if (response.status !== 200) {
this.#showFail();
return;
} |
Isn't the behavior shown in the this thread by design? https://github.com/uBlockOrigin/uBlock-issues/wiki/Resources-Library#no-fetch-ifjs- & https://github.com/uBlockOrigin/uBlock-issues/wiki/Resources-Library#no-xhr-ifjs-:
Anyway, AdGuard's fix: |
@gorhill firefox |
yes for |
What was done for |
Related issue: uBlockOrigin/uBlock-issues#2518
'expires'? |
'expires' was not added or is missing.. |
Adding |
@gorhill will the Resources-Library get a update? The latest features like |
I can update the wiki in a week or so. |
Still not updated |
Prerequisites
I tried to reproduce the issue when...
Description
Screencast.from.2023-03-01.14-13-33.webm
A specific URL where the issue occurs.
https://piquark6046.github.io/testpage/XMLResponseHeader/
Steps to Reproduce
The step to reproduce is attached in the video.
Expected behavior
XMLHttpRequest.prototype.status
returns200
.XMLHttpRequest.prototype.getResponseHeader('content-length')
returns a digit number.XMLHttpRequest.prototype.getResponseHeader('expires')
returns a date and time.XMLHttpRequest.prototype.getAllResponseHeaders()
returns response header of a request.Actual behavior
When a
$redirect
filter is applied:XMLHttpRequest.prototype.status
returns0
.XMLHttpRequest.prototype.getResponseHeader('content-length')
returns anull
.XMLHttpRequest.prototype.getResponseHeader('expires')
returnsnull
.XMLHttpRequest.prototype.getAllResponseHeaders()
returns an empty string.When a scriptlet filter is applied:
uBO version
1.47.2
Browser name and version
Mozilla Firefox Developer Edition 111.0b7
Operating System and version
Ubuntu 22.10
The text was updated successfully, but these errors were encountered: