Skip to content
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

Merged
merged 2 commits into from
Apr 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion deleteDiscordMessages.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
// @description Extends the discord interface so you can mass delete messages from discord
// @namespace https://github.com/victornpb/deleteDiscordMessages
// @version 4.2
// @match https://*.discord.com/*
// @match https://discord.com/app
// @match https://discord.com/channels/*
// @match https://discord.com/login
// @match https://ptb.discord.com/app
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// @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.

Copy link
Contributor Author

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.)

// @match https://ptb.discord.com/channels/*
// @match https://ptb.discord.com/login
// @match https://canary.discord.com/app
// @match https://canary.discord.com/channels/*
// @match https://canary.discord.com/login
// @downloadURL https://raw.githubusercontent.com/victornpb/deleteDiscordMessages/master/deleteDiscordMessages.user.js
// @homepageURL https://github.com/victornpb/deleteDiscordMessages
// @supportURL https://github.com/victornpb/deleteDiscordMessages/issues
Expand Down