WHAT THIS IS
This script shortens excessively long mailing list tags that appear in subjects. You can see a before and after comparison here.
The assumption is that the tag is either in the form:
[long-tag-here] rest of the subject
(i.e. in square brackets and separated by a space)
or it starts with "Re:", then space, then the tag, then space, then the rest of the subject.
Mailing lists with participants in another language than English might use a different reply prefix than "Re: ", you can adjust the code accordingly by duplicating the relevant if branch.
This script does not handle "Fwd: ..." messages since they're rare. It does also not handle subjects of the form "Re: new subject here, Was: [long-tag-here] old sibject here". This is not a standard format and it happens rarely and it would make the logic super complex, so I don't really care.
Very rarely, the script might flash the original tags for a split second. This will also happen while you're navigating e.g. through labels or results pages. This is normal. Fixing this would introduce a lot of code so it's not worth the hassle.
If you have any questions / comments / updates, ask on the Tek/HP/Etc Discord server, or email me. My email address is on the @author tag at the top of the file, you'll have to add the @ and .com in the correct places and remove the spaces from it.
HOW TO USE THIS SCRIPT
- Install the ViolentMonkey addon for Firefox. There are analogous addons for other browsers.
- Navigate to https://gf.qytechs.cn/en/scripts/455096-gmail-shorten-mailing-list-tags
- Click the big green "Install this script" button and follow instructions.
- Optionally, modify the user config that's marked USER CONFIGURATION SECTION.
- Refresh the GMail window for the script to start taking effect.
BEFORE AND AFTER COMPARISON
