[Update 5:30pm 8/29: I made a small change to OtherBrowser to make it less intrusive when you run it. It will no longer pop up in your dock for a second while it runs. There’s no update mechanism though. So re-download below and install as before.]
Since upgrading to Mountain Lion, and with it Safari 6, I’ve been doing my hardest to switch back to Safari as my default browser. I can’t really say why, maybe I’m just in the mood for change. Chrome is a fantastic browser. So is Safari. Safari’s UI just seems more polished, and less intrusive. I LIKE it. Anyway’s I’m trying.
I’m also trying to keep from installing Flash system wide, which means I can’t view flash on Safari. So I find myself switching between browsers a fair amount. I know other folks have offered up excellent tips, tricks, and scripts for grabbing your current page in Safari and opening it in Chrome. But none of them offered up what I wanted, which is a bookmarklet sitting in my bookmarks toolbar that I click and, shazam, the current page in the current browser is opened in the other browser. So I did some fiddling. And came up with OtherBrowser.
OtherBrowser is a VERY simple (21 lines of code) applescript application that makes it very simple to send a url to a specific browser (chrome and safari only) on your mac. The main use case here is a bookmarklet in your browser’s toolbar that will automatically send the current page to your other browser. I use this a lot when browsing on Safari I come across a site that requires flash. Hit my OtherBrowser bookmarklet (cmd–5 in safari for the fifth bookmark in the toolbar) and that site pops open in flash supporting Chrome. OtherBrowser works in the reverse direction as well (Chrome to Safari), it just requires a slight change to your bookmarklet.
OtherBrowser works by using OS X’s URL scheme support. OtherBrowser registers two new URL schemes:
Anytime you open a url on a mac with OtherBrowser installed that starts with one of those schemes (instead of, say, http://), that url gets sent to OtherBrowser instead of your Mac’s default browser. When OtherBrowser gets its hands on that URL, it sends safari url’s to safari, and chrome url’s to chrome.
I can’t imagine this not working. It’s very simple. But I’ve only tested it myself. Let’s call it a beta and all disclaimers related to it being a beta apply.
There’s more potential here. I might could build a browser extension that lets you use the OtherBrowser bookmarklet from a contextual menu. So right-click on a link and send that from Safari to Chrome. But this is a start.
You can dowload OtherBrowser here.
To install the app:
- Drag OtherBrowser somewhere on your mac. Your Applications folder is fine (as it is an application), but it’s a tiny app that you never launch directly. I keep mine in ~/Applications/.
- Right-click (or control-click) on OtherBrowser to bring up the contextual menu and select “Open” to launch it once. All this does is get you past Mountain Lion’s gatekeeper (sorry, I haven’t signed this) and to make sure OtherBrowser’s URL schemes get registered with OS X. The app will launch and immediately quit. And nothing else noticeable will happen. This is expected.
To install the bookmarklets:
- Open the text file titled “OtherBrowser Bookmarklets” in a text editor (TextEdit is fine).
- Copy the browser appropriate bookmarklet.
- Go to the browser you want to install the bookmarklet it in, create a new bookmark, paste the bookmarklet in as its address. Name it whatever. I use “toChrome” and “toSafari”
To Use: click bookmarklet when alternate browsing experience is desired…
P.S. Purely as a reference, so you know what you’re installing and how OtherBrowser works, I’ll paste in the Applescript source code below (you can also read it by showing OtherBrowser’s package contents, and checking out …/OtherBrowser.app/Contents/Resources/Scripts/main.scpt)
on open location a_URL set offs to offset of "://" in a_URL set this_URL to characters offs thru (count of a_URL) of a_URL as string set this_URL to "http" & this_URL as string set offs to offs - 1 set daScheme to characters 1 thru offs of a_URL as string if daScheme is "otherbrowser-chrome" then tell application "Google Chrome" open location this_URL activate end tell else if daScheme is "otherbrowser-safari" then tell application "Safari" open location this_URL activate end tell end if end open location
Safari Extensions Fix
An apology and a fix. When OS X updated to 10.7.3 a couple weeks ago, Safari was also updated to 5.1.3. Something about that update caused a small bug with one of my Safari extensions, InstapaperIt, where the toolbar button icons got real small. When I went to fix that bug, I discovered that back when I updated to Lion (haven’t worked on the extensions since then) I lost my Safari Developer Certificate; which signs all my extensions, and which Safari requires (as a security measure). Without the certificate, I couldn’t update any extensions.
I did the wrong thing in trying to re-install my certificate, and actually revoked it instead. This caused ALL my Safari extensions to break. And uninstall themselves automatically the next time a user launched Safari.
What a cluster-f$@#k.
Anyhow. I apologize for any confusion, annoyance, and the general screw up. Will try to avoid such pitfalls in the future.
I have installed a Safari Developer Certificate. I have recompiled my extensions. They should work. I also fixed the toolbar icon for InstapaperIt. You can download them below.
One quick caveat. Safari extensions have a built in auto-update mechanism. In a world where I didn’t revoke my certificate I could just release the updated extension and Safari would help you update it. Since I revoked the certificate, Safari probably uninstalled the extension, so there’s nothing to update. If somehow that didn’t happen, Safari might auto-update the extension. It might not. Uncharted waters. If you have any of my extensions still installed and can’t seem to update them, uninstall them and use the download links below.
nvIt — Chrome and Safari extensions for nvALT
Brett and I just released nvALT 2.1 with a lot of bug fixes, UI improvements, and some new features. Some of my favorite additions:
- TextMate style auto-pairing of matched characters like parenthesis, brackets, and double quotes.
- Shortcut (CMD-Shift-L) for Inserting [[Links]]
But I also just finished up developing Safari and Chrome extensions to extend nvALT’s notational velocity (or something ;) into the browser.
They let you create a new note in Safari 4 different ways:
- Click the toolbar button to have nvALT download the current page you’re on as a new note
- Right-click on a link, and select the appropriate option from the contextual menu, to have nvALT download the linked page as a new note.
- Right-click away from either a link or a selection, and select the appropriate option from the contextual menu, to have nvALT download the current page you’re on as a new note.
- Right-click on selected text, and select the appropriate option from the contextual menu, to have nvALT create a new note with the selected text as well as a link to the current page you’re on.
There’s an preference setting to have nvALT use Instapaper’s Mobilizer when downloading pages into new notes, so that those notes are more readable. This is not turned on by default. To turn it on go to the extension’s preference page.
Since these extensions require OS X and nvALT 2.1, I don’t have any plans to release them on their respective Browser’s extensions page. Check back here or follow me on Twitter @elasticthreads for updates to the extensions.
Please email any bug reports to elasticthreads att gmail.com with “nvIt bug report” in the subject
p.s. I’ll post the source for these on GitHub soon, but if you are willing and able to develop a Firefox version please email me.
InstapaperIt Safari extension users: if you updated to Safari 5.1 you need to re-enter Instapaper credentials in Preferences
If you updated to Safari 5.1 InstapaperIt might have stop working correctly for you.
When Safari updated to 5.1 it lost some of your extension settings. This includes your Instapaper login credentials you have to enter into InstapaperIt’s preferences.
- Go to Safari’s Preferences
- Click on the Extensions tab,
- Click on the InstapaperIt extension.
- Re-enter your username/password.
- Reload any pages currently open in Safari (so they reload the extension)
YASE (Yet Another Safari Exention)
Apple released Safari 5.0.1 today, enabling extensions and turned on its Extension Gallery. I went to grab its link and tweet it, but I wanted a shorter link, a good link, and easily done. So I wrote another extension to let you quickly make an is.gd shortened link by right-clicking on it and selecting is.gd in the contextual menu, or by shift-clicking on the link.
Too late to make it into the gallery, but get it here:
Instapaper Greystyled and Instapaper Article Tools extensions for Safari 5. It’s a quick implementation, but Apple’s made it pretty easy to turn a userscript into a Safari extension. (How cool is that?). More on the way. More integration into Safari’s UI, perhaps.
If you don’t already know them, they’re userscripts I’ve written. Instapaper Greystyled restyles Instapaper.com to look like this:
Instapaper Article Tools adds a subtle, floating toolbar next to the text articles on the website, so that while reading you can quickly navigate back, archive, star or delete an article, edit the text properties of the article, or page up, page down, and enable auto-scroll. It looks like this:
Update July 19: Yet Another Instapaper Extension: InstapaperIt gives you two ways of sending links to Instapaper to read later. When you’re surfin’ and you see a link to an article you want Instapapered, rather than having to open that link, wait for it to load, and then hit the instapaper bookmarklet or a toolbar button:
1. You can right click on the link and you’ll see a new item in your contextual menu “InstapaperIt”. Selecting that will send the link you’re right clicking on to instapaper.
2. You can pick (in preferences) either the shift key or the alt/option key. Hold down your chosen key while clicking a link and that will get sent to Instapaper in the background.
You’ll know the link has been sent when it turns black…
Get it here