64

As part of our discovery for providing a JavaScript API for user scripts, we want to know what user scripts you're currently using. This can be used to report user scripts that you use and the global window.StackExchange object properties and methods they depend on. This question can also include user scripts that depend on other global objects that we provide like window.StackOverflow.

To report a user script, use the following template, and report only one script per answer:

**User script name:**

**Primary audience:**

**Brief description:**

**Notes:**

**List of objects/properties/methods utilized:**

- item 1
- item 2

"Primary audience" would most frequently be "all users" but it may also be "close reviewers", "moderators", etc. Feel free to use the "Notes" section to add any details you think are valuable to mention about the user script including frequency of use, importance of access, how much worse your Stack Exchange experience would be without it, etc.

We'd also like to collect all of the individual dependencies used in a table, which will be accepted to keep it pinned as the top answer to this question. If you add an answer, please also add the user script name to the appropriate section of the table.

Knowing what dependencies are commonly used by user scripts will help us understand what dependencies should be available as we migrate to modules.

10
  • 6
    Dunno about calling them essential, but the main ones from the SOCVR repository are all popular: socvr.org/tools/userscripts
    – tripleee
    Commented Dec 14, 2021 at 16:27
  • Is it valuable to answer with userscript(s) that don't use Stack Exchange object dependencies (eg. because they use just the API), or is it just useful to catalogue scripts with dependencies that might break?
    – zcoop98
    Commented Dec 14, 2021 at 16:31
  • 8
    @zcoop98 more useful here to just focus on userscripts that have dependencies on window.StackExchange.*
    – Yaakov Ellis StaffMod
    Commented Dec 14, 2021 at 16:33
  • 6
    @zcoop98 Yeah, we're focused on the global dependencies we provide on our frontend like window.StackExchange. I know there's probably some other global objects (window.StackOverflow?) but I'm not sure if they're used in a userscripting context.
    – Kyle Pollard StaffMod
    Commented Dec 14, 2021 at 16:41
  • 1
    What about the Svg/Stacks helpers? Commented Dec 14, 2021 at 18:04
  • 4
    @double-beep Those would be great to list too as they're global dependencies we're providing, though I don't know yet if those will change with our module migration
    – Kyle Pollard StaffMod
    Commented Dec 14, 2021 at 19:49
  • @KylePollard StackOverflow global object is unlikely to be used widely (that is to say I do not know of any prominent use). That said, Models properties look like enums, might be possible to include them in type definitions if published/collaborated with community-maintained?
    – 0Valt
    Commented Dec 14, 2021 at 20:17
  • 5
    I've written two dozen userscripts of various complexity, but no hits when I search for StackExchange.. I found that hard to believe, but apparently I never wanted to rely on undocumented features...
    – Glorfindel Mod
    Commented Dec 14, 2021 at 21:54
  • Can someone include Roomba forecaster in the list?
    – bad_coder
    Commented Dec 21, 2021 at 16:47
  • 4
    I created one post per userscript as requested. For the full list with more info, see the spreadsheet I created for this purpose, as well as SOMU repo's readme for each userscript's features and screenshots. Commented Jan 16, 2022 at 5:42

52 Answers 52

28

If you add an answer, please also add the userscript name (with a link to your answer) to the appropriate section of the table below.

window.StackExchange

Property/Method Scripts (one per line, link to answer)
.beginEditEvent.cancel SE CV Request Generator
.comments.loadAll CheckForExistingCorA
.comments.uiForPost Advanced Flagging
.helpers.addSpinner "View Vote totals" without 1000 rep
.helpers.bindMovablePopups AutoReviewComments
SE CV Request Generator
.helpers.closePopus Flag Dialog Smokey Controls
.helpers.removeSpinner SE CV Request Generator
.helpers.removeSpinner "View Vote totals" without 1000 rep
.helpers.showConfirmModal Advanced Flagging
.helpers.showErrorMessage Flag Dialog Smokey Controls
.helpers.showErrorPopup "View Vote totals" without 1000 rep
.helpers.showModal Advanced Flagging
.helpers.showSuccessMessage Flag Dialog Smokey Controls
.helpers.showToast Advanced Flagging
.helpers.using Inline editor
.ifUsing SE CV Request Generator
.inlineEditing.init Inline editor
.initialized CheckForExistingCorA
.notify.close CheckForExistingCorA
SE CV Request Generator
.notify.show CheckForExistingCorA
SE CV Request Generator
.options.site.isMetaSite UserInfoSidebar
.options.site.name AutoReviewComments
.options.user.fkey Advanced Flagging
.options.user.isModerator Mod Flagger Stats
Flag Dialog Smokey Controls
Bookmark Users
.options.user.userId Advanced Flagging
Mod Flagger Stats
AutoReviewComments
.question.bindSuggestedEditPopupLinks SE CV Request Generator
.question.getQuestionId SE CV Request Generator
Bookmark Users
.question.init SE CV Request Generator
.question.initFull SE CV Request Generator
.ready AutoReviewComments
SE CV Request Generator
Format Stack Jobs CV for printing
Bookmark Users
.realtime.updateRelativeDates UserReviewBanHelper
.using SE CV Request Generator

window.Stacks

Property/Method Scripts (one per line, link to answer)
.application.register Bookmark Users
.attachPopover Bookmark Users
.setTooltipText Advanced Flagging
.setTooltipHtml Advanced Flagging
.showModal Advanced Flagging
.StacksController Bookmark Users

window.Svg

It would be nice to keep all the properties of that object or provide an API to create Stacks SVGs by name.

Property/Method Scripts (one per line, link to answer)
.Person Bookmark Users
0
18

Userscript name: Advanced Flagging

Primary audience: power users, content curators, people who like flagging posts a lot in general.

Brief description: adds an "Advanced Flagging" menu to posts to easily raise flags in two clicks and optionally leave helpful comments on the post based on the flag reasons. Additionally, it integrates with different existing bots/services (Smokey, Natty, Guttenberg, GenericBot) to detect reported posts and automatically send reports/feedback when flagging through its interface.

Notes: I am not a developer of this script, just an user, but this is easily the most useful script I use. It makes flagging and giving quick feedback through templated comments an effortless task.

List of objects/properties/methods utilized:

  • StackExchange.options.user.userId (self explanatory).
  • StackExchange.options.user.isModerator (self explanatory).
  • StackExchange.options.user.rep (self explanatory).
  • StackExchange.options.user.fkey to authenticate requests.
  • StackExchange.options.user.canSeeDeletedPosts (self explanatory).
  • StackExchange.options.site.name (self explanatory).
  • StackExchange.comments.uiForPost to display comments after automatically adding them (through POST).
  • StackExchange.helpers.showToast for simple status notifications.
  • StackExchange.helpers.showModal for configuration modals.
  • StackExchange.helpers.showConfirmModal for MetaSmoke auth.
  • StackExchange.realtime.reloadPosts to refresh posts after they have been deleted.
  • StackExchange.question.getQuestionId to fetch the question id.

  • Stacks.setTooltipText - to add a Stacks tooltip with text to an element.
  • Stacks.setTooltipHtml - to add a Stacks tooltip with HTML to an element.
  • Stacks.showModal - to make a Stacks modal visible given its HTML element
  • Stacks.attachPopover - to attach a given popover to an existing element.
  • Stacks.hidePopover/Stacks.showPopover - to control the visibility of a popover.
  • Stacks.detachPopover - to detach a popover from its control element
14

Userscript name: "View Vote totals" without 1000 rep

Primary audience: <1k users

Brief description: Currently, it's not possible for users without the "established user" privilege to view vote counts. This userscript makes them available for everyone.

List of objects/properties/methods utilized:

  • StackExchange.helpers.addSpinner() - should probably be replaced with Stacks' helpers (.addStacksSpinner(), though)
  • StackExchange.helpers.removeSpinner()
  • StackExchange.helpers.showErrorPopup()
13

Userscript name: AutoReviewComments (Machavity fork, but there's bound to be others)

Primary audience: SOCVR canned comment list users

Brief description: I still use the super-old AutoReviewComments. It's... been abandoned so I made my own fork (I know I'm not the only fork out there either) to keep it working for our use.

Notes: Up until now, it's just been CSS changes breaking things.

List of objects/properties/methods utilized:

  • StackExchange.ready
  • StackExchange.options.site.name
  • StackExchange.options
  • StackExchange.options.user
  • StackExchange.options.user.userId
  • StackExchange.helpers.bindMovablePopups()
9

User script name: Stack Exchange CV Request Generator

Primary audience: room members (owners, regulars or visitors) of SO Close Vote Reviewers (mainly), Charcoal HQ, Tavern on the Meta, SE Code Review Close Questions room, CURED, The Stack Exchange Network. Used a lot by SOCRV regulars.

Brief description: adds a "cv-pls" or "del-pls" menu to questions (and a couple of checkboxes in the close reason popup) which can be used to automatically send cv-pls or del-pls requests in different sites' chatrooms (e.g. most notably SOCVR on Stack Overflow).

Notes: not a dev, just a user of the script. I find this pretty useful even if I do not create a lot of requests myself. When I do though, this makes it an order of magnitude easier and faster than copy-pasting the question title, tags and link into the chatroom manually. Feel free to edit the list below if I missed something!

List of objects/properties/methods utilized:

  • StackExchange.{ready,ifUsing} to detect if/when different StackExchange functionalities are available to use.

  • StackExchange.notify.{show,close} as a better alternative to window.alert().

  • The following methods are not explicitly used, but they are replaced with a wrapper that emits events when called, so the script has a chance to add the "cv-pls" menu button at the right time:

    • StackExchange.question.init
    • StackExchange.question.initFull
    • StackExchange.question.getQuestionId
    • StackExchange.question.bindSuggestedEditPopupLinks
    • StackExchange.beginEditEvent.cancel
    • StackExchange.using
    • StackExchange.helpers.removeSpinner
  • StackExchange.helpers.bindMovablePopups: this is also wrapped in the same way and detects when the close reason selection popup is opened after clicking "Close" on a question.

8

User script name: Stack Overflow Unofficial Patch (SOUP)

Primary audience: General audience of all Stack Exchange sites, who frequently run into minor client-side issues in SE's current code

Brief description: To quote the GitHub repository description:

The Stack Overflow Unofficial Patch (SOUP) is a project to collect various minor client-side bug fixes, work-arounds and usability improvements for Stack Overflow and other Q&A sites on the Stack Exchange Network into a single user script.

The intent of SOUP is not to make any substantial or controversial changes to the Stack Exchange user interface, but to fix minor problems and omissions that the SE developers have overlooked or haven't got around to fixing yet. By combining these minor patches into a single user script, they become easier to install and maintain.

Notes: I run into quite a few of the client-side issues that this script addresses. As examples, I frequently click the top of the "Linked" bar on a question to access the full list of linked questions, and prefer to be able to see the "Close" button on a question in a different color if I've cast a close vote on it; both of these among others I frequently hit are implemented in this script.

The way the script's code is structured makes it easy for me to add additional fixes to my own copy of the script to work around other issues, which would be hard to do in their own, separate user scripts.

List of objects/properties/methods utilized:

Note that some of the fixes the script makes are no longer necessary as they were actually fixed by SE. Some other fixes also no longer work due to later SE changes, but that doesn't mean the code for them is no longer valuable: generally, it's just a class name change or similar.

  • StackExchange.helpers.submitFormOnEnterPress - used to work around this (possibly fixed) Firefox bug where pressing Enter in a context menu when composing a comment (e.g. client-side spell checkers) would unexpectedly submit the comment; team declined to fix as it only affected Firefox
  • StackExchange.options.user - implements this feature request for 20k+ users to have the delete button shown on answers immediately after casting a downvote rather than after a page refresh
  • StackExchange.helpers.disableSubmitButton - used to disable the comment submission button as part of a fix for this bug that text direction marker characters in comments cause other elements on the page to change
  • StackExchange.options.user.userId - used to find the current user's ID so that the "flags remaining" text in the flag dialog can link to the user's flag history

...plus some others, which I omitted due to the fixes being obsolete due to them being since implemented in SE code. I'd strongly recommend going through each of its fixes and implementing it in SE code so that it isn't necessary to maintain workarounds so this script continues to work.

5

Userscript name: Inline editor regardless of reputation (also part of SOX)

Primary audience: <2k users

Brief description: In order for inline editing, users need to have the "edit questions and answers" privilege. This userscript allows inline post editing even if the user is <2k rep.

List of objects/properties/methods utilized:

  • StackExchange.using - check if .inlineEditing exists
  • StackExchange.inlineEditing.init() - run inline editing JS
5

Userscript name: CheckForExistingCorA Show a warning message when you follow a link to a deleted answer or comment

Primary audience: Users that follow Smokey reported posts

Brief description: It can be confusing when a spam post / rude comment is already deleted but you can't really tell as there is no clear feedback. This script fixes that lack of feedback.

Notes: See also the original answer https://meta.stackexchange.com/a/251236

List of objects/properties/methods utilized:

  • StackExchange.initialized
  • StackExchange.notify
  • StackExchange.comments
4

Userscript name: Mod Flagger Stats

Primary audience: moderators and people obsessed with their helpful vs declined post flags ratio (like me).

Brief description: calculate and show user flagging statistics on hover in the mod flag queue and on user profiles. If not a mod, only shows a badge near your name in your user profile.

Notes: part of Samuel Liew's SO-mod-userscripts collection. I'm not the original dev, just a user and contributor.

List of objects/properties/methods utilized:

  • StackExchange.options.user.userId (self explanatory).
  • StackExchange.options.user.isModerator for mod status detection.
4

User script name: Flag Dialog Smokey Controls

Primary audience: Spam fighters (Charcoal)

Brief description: Enhances the flag dialog to automatically provide feedback to Metasmoke (basically, a database with information about possible spam posts)

List of objects/properties/methods utilized:

  • StackExchange.helpers.closePopups
  • StackExchange.helpers.showErrorMessage
  • StackExchange.helpers.showSuccessMessage
  • StackExchange.options.user.isModerator
4

Userscript name: AdditionalPostModActions

Userscript repo: https://github.com/samliew/SO-mod-userscripts

Primary audience: Moderators

Brief description: Adds a menu with mod-only quick actions in post sidebar
For full description and screenshots, please see README.md

List of objects/properties/methods utilized:

StackExchange.options.user.userId
StackExchange.options.user.fkey
StackExchange.options.site.parentUrl
StackExchange.options.site.childUrl
StackExchange.helpers.showErrorMessage()
3

Userscript name: Generic Review Tool (GRT)

Primary audience: Reviewers

Brief description: Automatically detects new review tasks and opens them in a new tab (a much lighter weight and actively maintained replacement for the older Review Stalker and Review Stalker Reloaded)

List of objects/properties/methods utilized:

GRT does not currently use any window.StackExchange methods; HTML/CSS changes are the main thing which occasionally breaks GRT/RSR (and some other scripts I've made which aren't worth posting here).

I also uh...didn't actually realize you could get the site ID using window.StackExchange, and that would make the code a lot cleaner for one of my older scripts (not going to post it here, since it was horribly hacked together and broke ages ago due to HTML/CSS stuff).

3

Userscript name: CommentFlagsHelper

Userscript repo: https://github.com/samliew/SO-mod-userscripts

Primary audience: Moderators

Brief description: Always expand comments (with deleted) and highlight expanded flagged comments, Highlight common chatty and rude keywords
For full description and screenshots, please see README.md

List of objects/properties/methods utilized:

StackExchange.options.user.isModerator
StackExchange.options.user.userId
StackExchange.options.user.fkey
3

Userscript name: DuplicateAnswersFlagsHelper

Userscript repo: https://github.com/samliew/SO-mod-userscripts

Primary audience: Moderators

Brief description: Add action button to delete AND insert duplicate comment at the same time
For full description and screenshots, please see README.md

List of objects/properties/methods utilized:

StackExchange.options.user.isModerator
StackExchange.options.user.fkey
StackExchange.options.user.userId
3

Userscript name: SearchbarNavImprovements

Userscript repo: https://github.com/samliew/SO-mod-userscripts

Primary audience: Everyone

Brief description: Searchbar & Nav Improvements. Advanced search helper when search box is focused. Bookmark any search for reuse (stored locally, per-site).
For full description and screenshots, please see README.md

List of objects/properties/methods utilized:

StackExchange.options.site.routePrefix
StackExchange.options.site.isChildMeta
StackExchange.options.site.name
StackExchange.options.site.parentUrl
StackExchange.options.site.childUrl
3

Userscript name: CreatePrivateModChatroom

Userscript repo: https://github.com/samliew/SO-mod-userscripts

Primary audience: Moderators

Brief description: One-click button to create private/mod chat room with user and grant write access
For full description and screenshots, please see README.md

List of objects/properties/methods utilized:

StackExchange.options.user.isModerator
3

Userscript name: UserReviewBanHelper

Userscript repo: https://github.com/samliew/SO-mod-userscripts

Primary audience: Moderators

Brief description: Display users' prior review bans in review, Insert review ban button in user review ban history page, Load ban form for user if user ID passed via hash
For full description and screenshots, please see README.md

List of objects/properties/methods utilized:

StackExchange.options.user.isModerator
StackExchange.options.user.userId
StackExchange.options.user.fkey
StackExchange.options.site.name
StackExchange.realtime.updateRelativeDates()
StackExchange.using("stacksEditor", ...)
StackExchange.stacksEditor.createAsync()
2

Userscript name: AdditionalInlinePostModMenu

Userscript repo: https://github.com/samliew/SO-mod-userscripts

Primary audience: Moderators

Brief description: Adds mod-only quick actions in existing post menu
For full description and screenshots, please see README.md

List of objects/properties/methods utilized:

StackExchange.options.user.userId
StackExchange.options.user.fkey
StackExchange.options.site.parentUrl
StackExchange.options.site.childUrl
StackExchange.helpers.showErrorMessage()
2

Userscript name: DisplayInlineCommentFlagHistory

Userscript repo: https://github.com/samliew/SO-mod-userscripts

Primary audience: Moderators

Brief description: Grabs post timelines and display comment flag counts beside post comments, on comment hover displays flags
For full description and screenshots, please see README.md

List of objects/properties/methods utilized:

StackExchange.options.user.isModerator
2

Userscript name: ModeratorHistoryImprovements

Userscript repo: https://github.com/samliew/SO-mod-userscripts

Primary audience: Moderators

Brief description: Better UI for mod action history page. Auto-refresh every minute.
For full description and screenshots, please see README.md

List of objects/properties/methods utilized:

StackExchange.realtime.updateRelativeDates()
2

Userscript name: NotAnAnswerFlagQueueHelper

Userscript repo: https://github.com/samliew/SO-mod-userscripts

Primary audience: Moderators

Brief description: Inserts several sort options for the NAA / VLQ / Review LQ Disputed queues
For full description and screenshots, please see README.md

List of objects/properties/methods utilized:

StackExchange.options.user.isModerator
StackExchange.options.user.fkey
StackExchange.moderator.renderTimeTicks
StackExchange.options.user.userId
2

User script name: Bookmark users

Userscript repo: https://github.com/mjpieters/SO-userscripts/tree/main/scripts/bookmark-users

Primary audience: Moderators

Brief description: Shows who has bookmarked a question, loading the list from SEDE and augmenting it with API data for each user.

Notes:

I looked for but did not find a method for formatting user reputation. I settled on using 2 Intl.NumberFormat() setups, one for unabbreviated scores (below 10k) and one for everything above. See the users.ts file. I'd love to see the API provide this.

List of objects/properties/methods utilized:

  • StackExchange.options.user.isModerator - deleted user accounts are not linked when the user is not a moderator.
  • StackExchange.question.getQuestionId - the current post ID to load bookmarks for
  • StackExchange.ready - only register the UI components when StackExchange is ready
  • Stacks.application.register - to register the controller
  • Stacks.attachPopover - the controller attaches a new popover
  • Stacks.StacksController - the extension is implemented as a Stimulus controller
  • Svg.Person - the icon used as the button to open the dialog box with users

The script makes heavy use of the Stacks CSS and JS frameworks, so I'm guessing that it is already quite far along the same direction that the StackExchange API would be heading.

1

Userscript name: Format Stack Jobs CV for printing

Primary audience: Just me. It's unpublished. I expect that others could use something similar if they wanted to customize the traditional view of their Dev Story for printing and/or PDF export.

Brief description: Maintains the non-printable view when printing. Modifies that view to optimize page breaks, add a LinkedIn URL in the header, rearrange some sections, and miscellaneous other layout tweaks.

List of objects/properties/methods:

StackExchange.ready(...), which is easily replaced. Also, lots of CSS properties. I generally need to update the script anytime I want to use it.

1

Userscript name: DeclinedFlagsNotifier

Userscript repo: https://github.com/samliew/SO-mod-userscripts

Primary audience: Moderators

Brief description: Show topbar indicator for recently declined flags
For full description and screenshots, please see README.md

List of objects/properties/methods utilized:

StackExchange.options.user.isModerator
StackExchange.options.user.userId
1

Userscript name: FetchQuestionStats

Userscript repo: https://github.com/samliew/SO-mod-userscripts

Primary audience: Everyone

Brief description: Display number of comments on each post in question lists. For mod queues, additional info (recent revision history) is also retrieved.
For full description and screenshots, please see README.md

List of objects/properties/methods utilized:

StackExchange.options.user.fkey
1

Userscript name: FetchVoteCountsAgain

Userscript repo: https://github.com/samliew/SO-mod-userscripts

Primary audience: Everyone

Brief description: Fetch vote counts for posts and enables you to click to fetch them again, even if you do not have sufficient rep. Also enables fetch vote counts on posts in mod flag queue as well as question/search lists!!!
For full description and screenshots, please see README.md

List of objects/properties/methods utilized:

StackExchange.options.user.rep
StackExchange.options.user.userId
StackExchange.helpers.addStacksSpinner()
StackExchange.helpers.removeSpinner()
StackExchange.ready()
1

Userscript name: ModBatchCommentDeleter

Userscript repo: https://github.com/samliew/SO-mod-userscripts

Primary audience: Moderators

Brief description: Batch delete comments using comment permalinks from SEDE
For full description and screenshots, please see README.md

List of objects/properties/methods utilized:

StackExchange.options.user.fkey
StackExchange.options.site.name
1

Userscript name: ModFlaggerStats

Userscript repo: https://github.com/samliew/SO-mod-userscripts

Primary audience: Everyone

Brief description: Post hover in mod flag queue, get and display flaggers stats. Badge links to user's flag history. Non-mods only can view their own flag badge on profile.
For full description and screenshots, please see README.md

List of objects/properties/methods utilized:

StackExchange.options.user.userId
StackExchange.options.user.isModerator
1

Userscript name: ModPopupDialogImprovements

Userscript repo: https://github.com/samliew/SO-mod-userscripts

Primary audience: Moderators

Brief description: Some simple improvements for posts' Mod popup dialog
For full description and screenshots, please see README.md

List of objects/properties/methods utilized:

StackExchange.options.user.isModerator
1

Userscript name: ModUserQuicklinksEverywhere

Userscript repo: https://github.com/samliew/SO-mod-userscripts

Primary audience: Moderators

Brief description: Adds quicklinks to user infobox in posts
For full description and screenshots, please see README.md

List of objects/properties/methods utilized:

StackExchange.options.user.isModerator
StackExchange.options.site.isChildMeta
StackExchange.options.site.parentUrl

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .