9

Description

This is a resurrection of the (now no longer accessible) UserScript Anonymize short links.

Specifically, this script implements this proposal by adding a checkbox (toggle switch) to each share popover.

When installing the UserScript, by default, there are no changes to behaviour. It does, however, add a toggle button that allows you to set your preference:

share popover from this stackapps question displaying link that contains a user id. Below the share link is an added toggle button "Include User Id" which is "checked" and green.

This toggle is used to both remove (or add) the user id from the share link, but also to set your network-wide preference. The UserScript saves this preference using GM_setValue and retrieves it using GM_getValue, for this reason only UserScript managers that support these operations are supported.

share popover from this stackapps question displaying link that does not contain a user id. Below the share link is an added toggle button "Include User Id" which is not "checked" and is grey.

At any time you are able to copy the opposite link without needing to change your preferences by clicking the copy button to the right of the toggle.

Installation

  1. Install a UserScript manager that supports GM_getValue and GM_setValue
  2. Add the UserScript to your manager install link (GitHub Source)
2
  • This looks very nice. But did you have to copy Stacks' horrible style of not rendering initialisms like "ID" in all caps?
    – Cody Gray
    Commented Sep 2, 2022 at 3:34
  • I guess it really should be all lowercase to match the subtitle "(Includes your user id)". :P Commented Sep 2, 2022 at 3:35

1 Answer 1

4

Add a button to copy the anonymized link regardless of the persistent preference. It is very plausible that the user would like to make a one-time copy of an anonymized link without actually changing the preference (or vice versa for that matter).

Adding a separate button should not require significant development effort as it could simply reuse the existing logic. As a quick mockup, it could look like this:

a mockup of the "share" popover with an "Anon copy" button added to the right of the "Copy link" button

2
  • 1
    This is now done in both directions. Slightly different UI (screenshots updated in the question), but both types of links are now always accessible regardless of preference for one-time copy purposes. Commented Sep 2, 2022 at 15:19
  • @HenryEcker cool, thanks :) Yeah, even better the way you did it - I just made a quick mockup to illustrate - like the dynamic switching between states.
    – 0Valt
    Commented Sep 2, 2022 at 15:29

You must log in to answer this question.

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