Skip to content

Support new set-constant scriptlet values of AdGuard #2615

Closed

Description

@piquark6046

Description

The following values are not supported in uBO:

  • noopCallbackFunc
  • throwFunc
  • noopPromiseResolve
  • noopPromiseReject
  • -1
  • yes
  • no

https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#set-constant

uBO version

1.49.0

Browser name and version

Mozilla Firefox Developer Edition 113.0b8

Operating System and version

Ubuntu 23.04

Activity

  1. gorhill commented on Apr 27, 2023

    @gorhill
    Member

    I am not seeing instances of set-constant filters using these values. Can I get a sense of usage stats for these?

  2. ghost added
    enhancementNew feature or request
    on Apr 27, 2023
  3. gorhill commented on May 12, 2023

    @gorhill
    Member

    I want to use a different approach than AdGuard. Instead of introducing new values (noopCallbackFunc, noopPromiseResolve, etc.), I want to introduce new ways to return currently supported values. Examples:

    ...##+js(set, property, value)
    ...##+js(set, property, value, asCallback)
    ...##+js(set, property, value, asResolved)
    ...##+js(set, property, value, asRejected)
    
    • The first one behaves as expected: property is set to value
    • The second one would return a function which returns value
    • The third one returns a Promise which resolves to value
    • The fourth one returns a Promise which fails with value

    Now I need real world cases where these can be tested.

  4. piquark6046 commented on May 12, 2023

    @piquark6046
    MemberAuthor

    @ameshkov Please take a look.

  5. ameshkov commented on May 12, 2023

    @ameshkov

    Good stuff

  6. ghost added a commit that references this issue on May 17, 2023
  7. added a commit that references this issue on May 19, 2023
  8. added a commit that references this issue on Jul 26, 2023
  9. stephenhawk8054 commented on Jul 1, 2024

    @stephenhawk8054
    Member

    @gorhill I just realized I don't see the options as (asCallback, asResolved...) in the current code: https://github.com/gorhill/uBlock/blob/master/assets/resources/scriptlets.js . Were they not transferred when switching to vararg approach?

  10. garry-ut99 commented on Jul 1, 2024

    @garry-ut99
  11. 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

    enhancementNew feature or requestfixedissue has been addressed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions