Skip to content

@include should ignore URL anchors #90

@SergeVDev

Description

@SergeVDev

Steps to reproduce

  1. Add the following header to a script:
// ==UserScript==
// @name			testname
// @description		testdesc
// @include			about:preferences
// ==/UserScript==
  1. Set pref("userChromeJS.persistent_domcontent_callback", true);.
  2. Navigate to about:preferences#home
  3. Restart the browser with Clear startup cache & Restart Firefox.

Expected behavior

The script is executed.

Observable behavior

The script is not executed.

Workarounds

Both @include about:preferences#home and @include * work. But the first requires the full list of possible anchors, and the second one requires explicit if (such as: if (R.UniStrings.FFSettingsUrls.some((url) => document.location.href.startsWith(url))), where FFSettingsUrls: ['about:settings', 'about:preferences']).

I tried to fix this in \chrome\utils\boot.sys.mjs, but since there are lots of regexps there, I'd better create a ticket instead ))

Additional

Maybe, URL wildcards are suitable. Something like @include about:preferences*.

Environment

Ver 0.10.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions