-
-
Notifications
You must be signed in to change notification settings - Fork 724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: stricter url matching #335
Conversation
@abbydiode This might be a good one for you as well? |
@SethFalco thank you for the detailed description |
following the same logic I added ptb and canary urls, someone requested it in another issue
|
@@ -6,6 +6,12 @@ | |||
// @match https://discord.com/app | |||
// @match https://discord.com/channels/* | |||
// @match https://discord.com/login | |||
// @match https://ptb.discord.com/app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// @match https://ptb.discord.com/app | |
// @match https://*.discord.com/app |
Maybe better to cover ptb
and canary
together like this?
Not sure if that would include no subdomain as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Matches any URL that uses the https scheme, is on a google.com host (such as www.google.com, docs.google.com, or google.com), as long as the path starts with /foo and ends with bar
— https://developer.chrome.com/docs/extensions/mv3/match_patterns/
Looks like *.discord.com
would actually match all 3, the base domain, and both subdomains.
Might be worth replacing the 9 entries with just 3 using *.discord.com
. (Haven't tested it manually.)
Bump Discord API version to version 9 and add more message type to be deleted PR looks good (#223 by VictorienXP) Add wildcard subdomain for discord.com match on the userscript (#224 by VictorienXP) Fix bug where process is prematurely stopped due to receiving a full array of skippedMessages (#323 by aijorgenson) fix: stricter url matching (#335 by SethFalco) refactor: reduce number of @matchs (#336 by SethFalco) Removed duplicate OR operator (#338 by aydinyal)
In user-scripts, you can use the match directive multiple times.
So we match
/channels/*
since that's what we need for the web app anyway.We also match
/app
and/login
for when a user is being redirected to the web app from them, totherwise the user script won't be initialized.This prevents issues like the following on other parts of the website:
/robots.txt
Main Site (i.e.
/company
)I believe the only pages we'd want the button to appear on would be under
/channels
anyway, for example:We then need to cover these because of web app navigation:
I tested the password reset flow (https://discord.com/reset) and can confirm there's no need to match this. It redirects to
/app
which is already covered.There's no need to cover
/channels
itself because that's a 404.