Screenshot / Code Snippet
About
Based off of Glorfindel's excellent userscript, this userscript displays users' pronouns (as mentioned in their chat or main site bios) under their usernames in chat and in user cards on Q&A sites. Additionally, this revised version has a few new tricks that the old one didn't:
- Avoids the deprecated DOM modification event API and therefore works correctly in modern browsers
- In chat, if a user doesn't have pronouns in their chat bio it will check the bio of their parent site as well
- Is capable of parsing links in bios to Pronoun Island (now defunct), https://pronouns.cc, and https://pronouns.page
The script will look for these ways of specifying pronouns for both chat and Q&A site bios:
- Explicitly specified pronouns prefixed by "Pronouns: " (case-insensitive, this behaves the same way as the old script), i.e.
pronouns: they/them
- Pronouns joined by slashes, i.e.
she/her/hers
orshe/her
; the script only looks for pronouns in this list provided by pronouns.page, so if you use neopronouns that aren't in this list you'll have to use the explicit form, or... - Links to profiles on pronouns.cc or pronouns.page, i.e. https://en.pronouns.page/@example or https://pronouns.cc/@example. The script will display the first listed set of pronouns with an opinion of "yes" or "favourite".
- Links to my.pronoun.is, i.e.
https://my.pronoun.is/he/him
; the site is now defunct, so this is mainly included for feature parity with the old script.
Pronouns are cached for 24 hours to avoid hitting Stack Exchange's API quota; to clear the cache manually, either:
- Ctrl-Alt-Shift-click on any pronoun element on the page added by the userscript
- or click the "clear pronoun caches" button in the preferences page for the site.
Caches are per-domain.
Download
The script may be installed directly with this link; the source is available on GitHub. A userscript manager like Tampermonkey is required to use this userscript. If installed correctly, my user card at the bottom of this question should look like this:
License
This userscript is licensed MIT, like all of my userscripts.
Contact
This script was created by me, Ginger, with some code reused from Glorfindel's userscript; to report issues, open an issue on GitHub or post an answer here.
Changelog
- 1.0: Initial release
- 1.1: Add a blacklist for users who weren't using the script responsibly
- 1.2: Fix broken pronouns on Q&A sites
- 1.3: Keep empty explicit pronouns from being shown
- 1.4: Add a button to clear the cache to chat/Q&A settings pages
- 1.5: Add reasonable default pronoun sets since pronouns.page has started returning an empty object from https://en.pronouns.page/api/pronouns
- 1.6: Correctly add pronouns to messages when the
load more messages
button is used - 1.7: Update blacklist