Open favorites in a new foreground tab?

12 views
Skip to first unread message

HornyToad

unread,
May 18, 2012, 7:15:12 AM5/18/12
to cani...@googlegroups.com
Hi Dev, 

I like your extension, though I seldom use Safari at all, but I have one question about tab management in general, regarding Safari: I've never found a way to open my favorites/bookmarks in a new tab in the foreground (nor in the background, for that matter) without resorting to Command-click or some special setting in my Trackpad. I know Safari's UI is only modestly scriptable, so maybe what I'm asking for is simply impossible, unless you hard-code it in Webkit, but I thought I'd ask the question. 

Simply put, I'd like to be able to do what Firefox users do when they install Tab Mix Plus on their browser. 

Chul Kim

unread,
May 18, 2012, 12:32:29 PM5/18/12
to HornyToad, cani...@googlegroups.com
Hi,

It's a reasonable wish. At the moment, I don't think it's achievable by a standard Safari extension. Here's why.

In order to force bookmarks to open in new tabs, an extension would have to do three things:
  • Notice when a new URL is about to be loaded in the active tab,
  • determine that this is happening because the user opened a bookmark (and not for some other reason), and
  • redirect the new URL to a new tab, leaving the current tab as it is.
The problem is the second step. Currently, Safari provides no way for an extension to know why the URL of the active tab (or any tab) is being changed. I can think of seven possible causes, but there are probably more:
  1. the user entered a new URL in the address bar
  2. the user performed a search from the address bar
  3. the user selected a bookmark
  4. the user selected a history item
  5. the user dragged and dropped an internet shortcut onto the tab
  6. the user clicked a link on the current page
  7. the page itself loaded a new URL by redirect or JavaScript
An extension can determine whether the cause is #6 above, because in that case there could be a script injected in the page that notices when a user clicks a link. But the other six cases all look the same from a Safari extension's perspective.

So, I could make an extension that forced bookmarks to open in new tabs. Unfortunately, it would also force new tabs in all the other situations in which a new URL is being loaded in the active tab.

Sorry for being so verbose when the answer is "no". I find that I think better by writing as I think.

Regards,
Chul
Reply all
Reply to author
Forward
0 new messages