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.
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.
StackOverflowglobal object is unlikely to be used widely (that is to say I do not know of any prominent use). That said,
Modelsproperties look like enums, might be possible to include them in type definitions if published/collaborated with community-maintained?
StackExchange.. I found that hard to believe, but apparently I never wanted to rely on undocumented features...