Remove Reddit Recents Bookmarklet

A bookmarklet is a small piece of JavaScript code saved as a bookmark in your web browser. When clicked, it performs a specific action on the current web page, such as modifying content or extracting information. Bookmarklets are a handy way to extend browser functionality without installing full-fledged extensions.

Javascript code for the Reddit bookmarklet

This is the all important javascript code where we manipulate your browsers local storage to remove "recent-subreddits-store". Copy this code to you clipboard, we are using it later.


javascript:(function() {
    const keyToRemove = "recent-subreddits-store";
    if (localStorage.getItem(keyToRemove)) {
        localStorage.removeItem(keyToRemove);
        alert(`The localStorage item "${keyToRemove}" has been removed.`);
    } else {
        alert(`No localStorage item named "${keyToRemove}" was found.`);
    }
})();

Create the Bookmarklet in Your Browser

For Google Chrome and Mozilla Firefox:

1. Show the Bookmarks Bar:
- Chrome: Click the three dots in the upper-right corner, go to Bookmarks, and select Show bookmarks bar.
- Firefox: Click the hamburger menu, select Bookmarks, then Bookmarking Tools, and choose Add Bookmarks Menu to Toolbar.

2. Create a New Bookmark:
- Right-click on the bookmarks bar and select Add page... (Chrome) or New Bookmark... (Firefox).

3. Enter Bookmark Details:
- Name: Give your bookmarklet a name (e.g., "Remove Recents").
- URL/Location: Paste our JavaScript code here.

4. Save the Bookmark:
- Click Save to add the bookmarklet to your bookmarks bar.

← Back