Sunday, August 21, 2011

Mobile Safari+Instapaper tip

If you’ve ever been reading a page in Mobile Safari and wished you were reading it in Instapaper instead, this is the quickest way to back that happen: Install the javascript below as a bookmarklet in Safari. Whenever you want to add an article to Instapaper and switch to instapaper all you have to do is hit that bookmarklet up.

javascript:function%20ipNOW(){var%20d='i'+document.location;document.location=d;}ipNOW();void(0)

How does it work? A while back Instapaper added a url scheme “ihttp://…”. So that any url you open on your iOS device instantly switches you to Instapaper and adds that url (minus the ‘i’, of course) to your articles. This bookmarklet just takes the url of the webpage you’re at, prepends an ‘i’, and opens that link.

As with all bookmarklets and Mobile Safari, the clunkiest part is the install. Here’s one way to do it:

1. If you’re not reading this post in Mobile Safari, switch over to your iOS device and come back. Here’s a link back here, if that helps.

2. Bookmark this page on Mobile Safari. Go through all the steps to actually bookmark this page, only you can rename to bookmark to what you’d like your bookmarklet to be called, lets call it “ipNOW” as an example.

3. Scroll up to the javascript above, select it and copy it.

4. Go back to your bookmarks, tap the “Edit” button, and select the bookmark you created in Step 2. Tap the url field for that bookmark to edit it. Tap and hold and select all of the old tumblr url. Delete. Tap and hold and paste in the javascript.

done.

UPDATE: if you tried that javascript and it got scrambled on copy/paste in mobile safari, that was because i didn’t use the <code>tag</code> .  I fixed it. Try again. SHOULD work this time.