Created
September 19, 2025 09:27
-
-
Save impliedgg/9e8549472e94a300487c8aff10d594a9 to your computer and use it in GitHub Desktop.
stackoverflow user id gatekeeper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| quick-and-dirty. update this yourself if you want better code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name StackOverflow UserID Gatekeeper | |
| // @namespace github@impliedgg | |
| // @match https://stackoverflow.com/* | |
| // @grant none | |
| // @version 1.0 | |
| // @author github@impliedgg | |
| // @description For StackOverflow. Automatically strips UserID from your URLs before you copy them. | |
| // ==/UserScript== | |
| setTimeout(()=>{ | |
| if ($('#user-profile-button').length > 0) { // user signed in? | |
| $("a.js-share-link").each((i, obj) => { | |
| $(obj).removeAttr("data-se-share-sheet-subtitle"); // removes subtitle display from popover when created | |
| let splitLink = $(obj).attr('href').split("/"); // remove second half of url w/ userid | |
| splitLink.pop(); | |
| $(obj).attr('href', splitLink.join("/")); | |
| }) | |
| } | |
| }, 500); // long timeout for low speed connections |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment