Reddit notifications dropdown

add notifications dropdown to reddit

< Feedback on Reddit notifications dropdown

Review: Good - script works

§
Posted: 29. 09. 2025
Edited: 29. 09. 2025

Added a line to your 2nd-to-last function so that ctrl+click still opens links in new tabs (rather than the parent frame) like it normally would. (I could not figure out how to make shift+click open links in a new window, though)

function setupIframeLinkHandler() {
    document.addEventListener("click", (event) => {
        const targetA = event.target.closest("a[href]");
        if (targetA) {
            event.preventDefault();
            console.log(unsafeWindow.top);
            if (event.ctrlKey) {
                unsafeWindow.open(targetA.href);
            } else {
                unsafeWindow.top.navigation.navigate(targetA.href);
            }
        }
    });
}
hdyzenAuthor
§
Posted: 29. 09. 2025
Edited: 29. 09. 2025

Hey, thanks for the feedback. I understood your idea and just updated the script. Links should now open natively, meaning:

Left click = Current window
Shift + Left click = New window
Ctrl + Left click = New tab
Middle mouse = New tab

§
Posted: 03. 10. 2025

Thanks! You're so awesome. I understand if you don't want to be bothered any more about this, but two other real minor things I noticed:

  1. Clicking outside of the popup frame should probably dismiss it, right? Currently the only way I can see to dismiss it is to click the notification icon a second time.
  2. After clicking "Mark All As Read" in the popup, is it possible to remove the unread counter on the notification icon?
hdyzenAuthor
§
Posted: 03. 10. 2025

I understand if you don't want to be bothered any more about this

It's ok.

Clicking outside of the popup frame should probably dismiss it, right? Currently the only way I can see to dismiss it is to click the notification icon a second time.

Added this, it should dismiss when clicking outside the popup.

After clicking "Mark All As Read" in the popup, is it possible to remove the unread counter on the notification icon?

I added a similar behavior, natively. If you view the notifications popup, it already removes the counter in the backend. So if I added it only when clicking "Mark All As Read" and you don’t click but view the popup and reload, the counter is already gone. Therefore, the script will remove it when clicking on notifications.

Thanks for the feedback. I really appreciate the ideas.

Post reply

Sign in to post a reply.

长期地址
遇到问题?请前往 GitHub 提 Issues。