GeezerVison is showing github.com — [Bug] Setting the wrong user @match prevents opening the menu · Issue #3171 · greasemonkey/greasemonkey
[Bug] Setting the wrong user @match prevents opening the menu #3171DescriptionIf the incorrect syntax “user@match” is set, then the Greasemonkey menu will not open at all.
It is still possible to recover from this situation, as Greasemonkey menus can still be opened in about:addons and so on.
Error: @match: Invalid host specified. MatchPattern.js:81:11
|
if (!REG_HOST.test(host)) { |
|
throw new Error("@match: Invalid host specified."); |
|
} |
Activityarantius commented on Nov 2, 2023 Confirmed. This comes from inside monkey-menu.js in the loadScripts() function, when checking whether the script runs on the current page. arantius commented on Nov 3, 2023 For a bit more detail: This bug comes through
|
function loadScripts(userScriptsDetail, url) { |
calling
on each script, which relies on
.
If this last helper, _testCludes() finds a match from includes, excludes, or any match before the invalid user match nothing happens. (This is effectively the workaround, except that comes from runsOn() and causes it to never call the helper at all.) If none of these cases occur, we get to the bottom of _testCludes() which involves attempting to parse the (user) match string into a match object, which previously failed and was uncaught. Any invalid user match, not just the literal user@match will trigger this failure, if the code gets this far. Reacted by 100の人 (エスパー・イーシア) Reacted by 100の人 (エスパー・イーシア) arantius commented on Nov 5, 2023 Reacted by 100の人 (エスパー・イーシア) arantius commented on Nov 29, 2023 This should be done. I could use your help testing this! Checkout or download Greasemonkey's source code, then follow the documentation for installing an extension during development. As far as I know this will break installed scripts, so you should use about:profiles to create and launch a new blank Firefox profile to do so, rather than overwriting your existing Greasemonkey install. (Maybe take a Greasemonkey backup first to be safe.)
Any testing results, positive or negative, would be great. esperecyan commented on Nov 29, 2023 ContributorAuthor More actions Thanks for the fix! I was able to confirm that can open the menu with the incorrect user @match by testing the following steps.
- In Greasemonkey 4.11, adds
https://*example.com/* to user @match.
- Confirmed that the menu no longer opens.
- Installs 8bd283f.
- Confirmed that can open the menu and can remove incorrect @match.
added a commit that references this issue on Nov 24, 2024This issue will close once commit eac5832 is merged into the 'master' branch.eac5832
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|