Skip to content

'XMLHttpRequest.prototype.getResponseHeader()' issue in scriptlet and redirect #2518

Description

@piquark6046

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

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.

piquark6046.github.io##+js(no-xhr-if, adsbygoogle.js)
||pagead2.googlesyndication.com/pagead/js/adsbygoogle.js$redirect=googlesyndication_adsbygoogle.js
@@||pagead2.googlesyndication.com/pagead/js/adsbygoogle.js

Expected behavior

  • XMLHttpRequest.prototype.status returns 200.
  • 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 returns 0.
  • XMLHttpRequest.prototype.getResponseHeader('content-length') returns anull.
  • XMLHttpRequest.prototype.getResponseHeader('expires') returns null.
  • XMLHttpRequest.prototype.getAllResponseHeaders() returns an empty string.

When a scriptlet filter is applied:

  • All methods and property return empty data.

uBO version

1.47.2

Browser name and version

Mozilla Firefox Developer Edition 111.0b7

Operating System and version

Ubuntu 22.10

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions