Skip to content

Instance properties of 'Response' issue in scriptlet and redirect #2526

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-05.09-17-53.webm
Screencast.from.2023-03-05.09-16-58.webm

A specific URL where the issue occurs.

https://piquark6046.github.io/testpage/FetchResponse/

Steps to Reproduce

The step to reproduce is attached in the video.

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

Expected behavior

Instance properties of Response return consistently like an unblocked request.

Actual behavior

Instance properties of Response return various values.

uBO version

1.47.2 (Firefox); 1.47.4 (Brave)

Browser name and version

Mozilla Firefox Developer Edition 111.0b8; Brave 1.48.171

Operating System and version

Ubuntu 22.10

Activity

  1. uBlock-user commented on Mar 5, 2023

    @uBlock-user
    Member

    same as #2518 but this one is about fetch() ?

  2. piquark6046 commented on Mar 5, 2023

    @piquark6046
    MemberAuthor

    #2518 issue can be handled by creating a Proxy for only XMLHttpRequest.prototype.getResponseHeader and XMLHttpRequest.prototype.getAllResponseHeaders.

    But, to resolve this, uBO handles Response.prototype.redirected, Response.prototype.url and Response.prototype.headers.

  3. uBlock-user commented on Mar 5, 2023

    @uBlock-user
    Member

    Something to mind -

    image

    ^ As long as above CORS policy remains in effect, browser will not allow data: stub resources from the extensions to load(resulting in a failed redirect), invariably causing different values to appear in the above case as well as in #2518

  4. piquark6046 commented on Mar 5, 2023

    @piquark6046
    MemberAuthor

    Real use case where it is actually needed?

  5. piquark6046 commented on Mar 17, 2023

    @piquark6046
    MemberAuthor

    A real world case found.
    In this case, AdGuard Browser Extension 4.1.53 is not affected.

    It was a mistake.

  6. MasterKia commented on Aug 10, 2023

    @MasterKia
  7. added a commit that references this issue on Nov 25, 2023
  8. uBlock-user commented on Nov 26, 2023

    @uBlock-user
    Member

    @piquark6046 now you can use piquark6046.github.io##+js(no-fetch-if, adsbygoogle.js, war:googlesyndication_adsbygoogle.js)

  9. gorhill commented on Nov 29, 2023

    @gorhill
    Member

    Closing as fixed, in current dev build.

    I didn't add Expires response header: it's an optional header and one of many others, I don't think it's a good for now to start arbitrarily adding response headers.

  10. added a commit that references this issue on Jul 16, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions