Safari pinboard.in extension 1.9

Here’s an update for Pinbar – a Safari extension for pinboard.in.
Adding pages in a pop-up works now (sounds easy, but wasn’t..:) and via drag & drop. Read on…

Add to Pinboard via Pop-up

In the Pinbar preferences you can choose to add bookmarks in a pop-up (Just like the “popup”-bookmarklet from pinboard.in).

You have to disable the popup-blocker in Safari (Preferences -> Security) – or you get a warning message.

Here’s the settings menu:
In the settings you find "popup" now.
And then you add bookmarks in a popup window, like this:
A popup window, nice nice

Technical explanation: Usually Safari Extensions can’t open popup-windows – because it’s not possible to use “window.open()”. So I had to implement an ugly hack (a very ugly one), which injects javascript in the current page and simulates a mouse-click event, which then opens a popup window. I’m still surprised that it works… And at that stage, it was no moral problem to implement another bad hack, which notifies the user if the popup could not be opened – which usually means, the popup-blocker is enabled.

Drag & Drop

You can drag URLs from the address bar or links from the website, or images or whatever onto the Pinboard toolbar – and if you drop it, you can bookmark it directly.

Like this:
Drag & Drop Explanation

Fun, because it is native HTML5. But not 100% what I wanted, because you can’t use dragndrop for the buttons on the main Safari toolbar (the grey buttons).

Context menu

You also have a context menu available (right-click on the current page), where you can add the page to pinboard or save it as “read later”. This context menu can also be disabled in the settings.

Misc other stuff

  • Toolbar has a close button now You can show the toolbar again in the “View”-Menu from Safari
  • If you want to search and the toolbar is hidden: it appears and you can enter text to search for (and disappears afterwards)
  • Shortcut for “Show unread items” (by default Cmd-Shift-U)
  • Icons now look even more confusing