Skip to content

Instantly share code, notes, and snippets.

@alxndr
Last active April 23, 2023 02:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alxndr/8a076de3589730197fdb6e81c9726fd4 to your computer and use it in GitHub Desktop.
Save alxndr/8a076de3589730197fdb6e81c9726fd4 to your computer and use it in GitHub Desktop.
bookmark to scroll to the red line on phish.net's forum

This will walk you through adding a "bookmarklet" to your browser, which will scroll you to the red "read" marker on the Phish.net Forum.

It is written with Google Chrome & Chromium-based desktop browsers (e.g. Brave) in mind, but may also work with contemporaneous browsers such as Firefox. (Not sure how/whether bookmarklets work on mobile browsers...)

If you find this useful, please say thanks by donating to the Mockingbird Foundation (they keep phish.net running!), tell 'em @sevenpounds sent you.

Steps

  1. Check that the Bookmarks bar is visible (e.g. under the URL bar) when you're reading a thread.
    • ...if it's not visible, open the browser's Settings > Appearance and look for a "Show bookmarks" option — set the dropdown to "Always". This will add an area underneath the URL bar with buttons for each of the bookmarks in the top/main Bookmarks folder.
    • ...then check again on a thread.
  2. Create a new Bookmark in the bookmarks bar (right-click on bookmark tab & select "New Page"; or open Bookmark Manager & select the top Bookmarks folder before adding new book)
    • Name field: Pick something short and/or memorable; this will be the label on the button which you will be clicking. (I use an emoji like 📌 )
    • URL field: Copy the whole line of code below, and paste it into the URL bar — and before you save, check to see if the javascript: at the beginning is there, and if it's not, add it:
javascript:(m=document.getElementsByClassName('thread_progress_marker')?.[0])&&scrollTo({top:m.offsetTop-(innerHeight/2)})

...the beginning of the bookmarklet's URL field should look like this:

screenshot of Name & URL fields when adding a new bookmark to Chromium

Success

Now when you are on a Phish.net Forum thread, and you click the button for this new bookmarklet, the scroll position will jump right to the red "last read position" line (if there is one on the page; if not then nothing will happen).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment