Wednesday, August 29, 2012

OtherBrowser

[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:

otherbrowser-safari:// 
otherbrowser-chrome:// 

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.

So along with the app itself, I’ve included a javascript bookmarklet for each browser that takes the url in your current tab at switches it to one of these URL schemes. Which sends the URL to OtherBrowser which sends it along to the other browser. I should say this sounds like a lot, and is a mouthful (or keyboardful) to write. But goes very quick in practice. Almost instant.

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…

Enjoy,

David Halter

aka ElasticThreads


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 
Monday, March 12, 2012

nvIt for Chrome update

I’ve updated the Chrome version of my nvIt extension, which gives you various ways of creating notes in nvALT from your browser. Couple things about it:

  • Back when I originally released the Chrome version, I did not implement an auto-update mechanism correctly. Apologies. So if you already have nvIt installed in Chrome: Go to chrome://extensions and remove the old version. Then install the new version. Auto-updating should work from here on out, so this is the only time you’ll have to do this.
  • The update fixes a bug in the extension (caused by a change in Chrome itself) that removed all paragraph and line endings from selected text if you went to create a note from selected text. The result was an unreadable, condensed block of text. Now fixed.
  • The update fixes a bug that screwed up creating a note with selected text on a web page whose URL contained a certain set of funny characters.
  • The update does not fix a bug in the current beta (version 2.2) of nvALT (since the bug is not in the extension) that causes it to crash when creating a note by importing from a URL. This bug will be fixed in nvALT in the next beta update. In the meantime, I recommend only using the extension to create notes using selected text. Once the bug in nvALT is fixed, the extension should work just fine.
  • Safari users: no update for you. Pretty sure that version works fine already. Also, the auto-update mechanism already works for the Safari extension. 

Download the new version of nvIt for Chrome, here.

It’s not an update, but here’s a quick link to the Safari version of the extension.

Friday, July 29, 2011

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]]

Read more about it here.  Full release notes here. You can use the in-app update mechanism or download it here.

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

Downloads:

Safari Extension

Chrome Extension

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. 

Monday, November 22, 2010
Chrome tip: utilize the “search engines” list to add quick omnibar access to favorite sites, chrome pages (downloads,extensions, bookmarks), and more search engines.
Yubnub as the default is key (for me at least), learn a few quick prefixes and the whole web is immediately accessible and searchable. Sure, “g searchphrase” searches google through yubnub, but yubnub does take that extra second to redirect, so I add my most used yubnub prefixes as keyword searches to chrome, so “g searchphrase” goes direct to google. Yes, I have two entries for Google Maps. I sometimes add an “s” to “gmap”, and rather than try and fix my own habit, I just added another entry.
For those who love the Google Instant feature (in about:flags), it still works with non-google searches. 
Some of the URLs I use:
wikipedia  :  http://en.wikipedia.org/w/index.php?title=Special:Search&search=%s
google maps : http://maps.google.com/maps?q=%s
google images : http://images.google.com/images?q=%s
yubnub : http://www.yubnub.org/parser/parse?command=%s
amazon : http://www.amazon.com/exec/obidos/external-search?mode=blended&keyword=%s
downloads : chrome://downloads/
extensions : chrome://extensions/
bookmarks : chrome://bookmarks/

Chrome tip: utilize the “search engines” list to add quick omnibar access to favorite sites, chrome pages (downloads,extensions, bookmarks), and more search engines.

Yubnub as the default is key (for me at least), learn a few quick prefixes and the whole web is immediately accessible and searchable. Sure, “g searchphrase” searches google through yubnub, but yubnub does take that extra second to redirect, so I add my most used yubnub prefixes as keyword searches to chrome, so “g searchphrase” goes direct to google. Yes, I have two entries for Google Maps. I sometimes add an “s” to “gmap”, and rather than try and fix my own habit, I just added another entry.

For those who love the Google Instant feature (in about:flags), it still works with non-google searches. 

Some of the URLs I use:

wikipedia  :  http://en.wikipedia.org/w/index.php?title=Special:Search&search=%s

google maps : http://maps.google.com/maps?q=%s

google images : http://images.google.com/images?q=%s

yubnub : http://www.yubnub.org/parser/parse?command=%s

amazon : http://www.amazon.com/exec/obidos/external-search?mode=blended&keyword=%s

downloads : chrome://downloads/

extensions : chrome://extensions/

bookmarks : chrome://bookmarks/

Tuesday, October 26, 2010

YouTube5, Chromed

I adapted Connor McKay’s excellent Safari extension, YouTube5 (the website currently is fireballed), which forces YouTube to play videos in HTML5 format, into a Chrome extension.

Get it here.

It’s not quite as useful as the Safari version because, unfortunately, Chrome’s native HTML5 video player does not have fullscreen ability. A workaround is to right-click on the video and “open video in new tab” which opens video in a new tab and takes up almost the whole window.

I’ll try and work on a better fullscreen implementation and a way to quickly switch back to flash for those wanting fullscreen. But its a start towards flash-free goodness on Chrome. 

Friday, September 10, 2010

Beautipedia Modified, Chromified

Just published Beautipedia Modified, Chromified — A Chrome extension to restyle Wikipedia, based on the excellent Safari extension(s) by Brendan Clarke and David Jones.

Friday, August 27, 2010

Chrome Web Apps preview

Chrome 6 (the beta channel) or 7 (the dev channel) let you use the new Google Web Apps. I thought I’d run them down a bit for you. You can see in the screenshot below, I’ve got Apps for Instapaper and GMail installed. What a web app is is still evolving, for now they’re pretty simple; particularly if developed by a 3rd party. If Instapaper wants to develop a web app with offline articles available (similiar to its iPhone app), it could; but as a 3rd party the “Instapaper” app I developed only does a few basic things:

1. Adds a nice link in the new tab page (see the screenshot below).

2. Clicking that link opens a pinned tab (see the smaller tab with the Instapaper icon to the left of the active tab in the screenshot). If you quit Chrome with a web app tab open its state  gets saved and restored the next time you run Chrome.

3. Lets me designate a tab icon for Instapaper. 

If you want to run these yourself:

1. Get on the chrome dev channel.

2. Download a .zip of the following apps: GMail, Google Calendar, and Instapaper. A few disclaimers about them:

  • These are not official releases by me, the Gmail and Google Calendar apps are actually included inside the application bundle of Chrome 7 (I just copied them out for easier access).
  • I will not be updating these.
  • The apps are very simple manifest files and icons so there’s no chance for bugs.
  • I included the source code so you can make your own and/or modify them.

3. Unzip the file you just downloaded and you’ll see the three apps, (they have a .crx extension). On a Mac you can just drag them to Chrome’s dock icon to install. On Windows you’ll need to open them with Chrome some other way (try and drag them onto an open Chrome window).

4. You can manage, disable, or uninstall them in chrome’s extensions page.

Thursday, August 26, 2010

Chrome 7 and OS X

If you’re a Google Chrome user, or considering it, on OS X: Go download and try out the dev channel build*.  Yesterday the Chrome team updated its dev channel to Chrome 7, which includes big improvements to rendering speed and stability but also, shocker — better integration with OS X. This includes:

  • The development of a real Applescript dictionary (something Firefox doesn’t have), adding one more way to script Chrome.
  • Chrome now enables OS X Services, which in Snow Leopard are quite powerful ways of piping text and other data from one application to another or to a service.
  • Chrome also lets you send selections to  the system wide dictionary.app

* Safari has 2 basic “channels” of build, the official stable Safari releases, and the “Webkit Nightly” builds which are released every day and might be of questionable stability/reliablity. 

Chrome on the other hand has 4 concurrent channels of builds you can use.

  • The official “Stable”, or release, version of Google Chrome; the most stable, but also the most behind the features and development curve.
  • The beta channel which is very stable and has newer features than the Stable channel; this build is actually suitable for most users (remember that Google kept gmail in beta for years. Beta is sort of the new release for Google), its just not certifiably solid.
  •  Then there’s the Dev channel, which contains a lot of new features, its kind of the testing ground for UI changes and features; some stay, some change, some come and go. You can get a good idea of the future of Chrome by trying out the dev channel, and it’s actually pretty stable; I use it day to day for a lot of browsing and almost never crash it.  
  • Finally, there’s Chromium, which is the open source base for Chrome, a lot of the development of Chrome happens there, lots of changes from day to day that might eventually come downstream to the other builds, not really for day to day browsing. 
Tuesday, August 17, 2010

The InstapaperIt extension for Chrome has been updated

Get it here.

It does require Chrome 6, which means you need to be on the beta or dev channels (a stable channel Chrome 6 should be along shortly). It requires Chrome 6 because the newer versions have expanded the extensions API to allow developers to add contextual menu items. 

Which means this update for InstapaperIt now matches InstapaperIt for Safari. You can right click on a link and send it to Instapaper in the background, you can right click off a link and send the current page to Instapaper, you can click the toolbar button to do that also.