Shorts

  1. Where From?

    If you’re like me, you probably have tabs that stay open for days (even weeks) on end, waiting to be read and closed. Unfortunately, in case you liked what was on that page, two weeks later you don’t remember how you actually got there.

    So I decided to write a bookmarklet that shows you that. Kind of. It’s a rather non-fancy script that tries to determine the context based on the three ways (that I could think of) you might have reached a page:

    • Clicking a link in an app which is not your browser. This is the ugliest case, because the browser has absolutely no knowledge of the context. The OS does, I’m sure, but it doesn’t tell the browser—or at least, I don’t think it does.

    • Opening a new tab and typing in the URL. There’s no need to handle this case—you know how you got there. This and the previous case are handled the same way, with a shrug of the shoulders and a shake of the head.

    • Clicking a link on some other page. This is the case this bookmarklet tries to make sense of. It does two things: First check if you got to your page from a Google search. If you did, it gives you a link to perform that search again. Since most people don’t go beyond the first page of results, this will pretty much serve everybody.

      If you didn’t get to your page from a Google search, it looks up the URL you did come from, and gives you the title of the page along with a link back.

    Drag the Where From? bookmarklet to your bookmarks bar. You can click it and see how you reached this page, to try it out.

    It seems to work well in Chrome and Firefox, but if you run into errors, leave a comment on the gist and I’ll have a look.


    n.b. Using “Open In New Tab” from the context menu clears the document.referrer in Chrome 11, but not in Firefox. Using Cmd+click to open links in a new tab keeps the referrer intact. According to this ticket, it should be fixed in Chrome 12.

  2. /
 
  
  Archive   Colophon