Hello there,
The userscript runs on https://beta.musicbrainz.org/release/add?skip_confirmation=1 however it shouldn't. There's no release on this page. This is because the script match rule is too broad:
https://beta.musicbrainz.org/release/*
Perhaps you need an additional filter within the script, like so:
const releaseGuidMatch = location.pathname.match(
/^\/release\/[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i
);
if (!releaseGuidMatch) {
return;
}
since @match directives don't support RegEx.
I discovered this because the script actually crashes on the Add Release form, since it cannot find the header element:
This also needs to be mitigated, potentially with an optional chaining, since we cannot assume that document.getElementsByClassName("releaseheader")[0] will always be present.
On another note, I've been helping with maintaining Murdos's Userscripts Repo over the last year or so: would you mind if I integrate your code into the Musicbrainz UI enhancements script? That script already supports flags, so each user can chose what features to enable or disable.
Hello there,
The userscript runs on
https://beta.musicbrainz.org/release/add?skip_confirmation=1however it shouldn't. There's no release on this page. This is because the script match rule is too broad:Perhaps you need an additional filter within the script, like so:
since
@matchdirectives don't support RegEx.I discovered this because the script actually crashes on the Add Release form, since it cannot find the header element:
This also needs to be mitigated, potentially with an optional chaining, since we cannot assume that
document.getElementsByClassName("releaseheader")[0]will always be present.On another note, I've been helping with maintaining Murdos's Userscripts Repo over the last year or so: would you mind if I integrate your code into the
Musicbrainz UI enhancementsscript? That script already supports flags, so each user can chose what features to enable or disable.