{"id":7176,"date":"2010-06-11T12:46:42","date_gmt":"2010-06-11T19:46:42","guid":{"rendered":"http:\/\/wapreview.com\/?p=7176"},"modified":"2013-09-17T18:43:38","modified_gmt":"2013-09-18T01:43:38","slug":"bookmarklets-on-android","status":"publish","type":"post","link":"https:\/\/wapreview.com\/7176\/","title":{"rendered":"Bookmarklets on Android?"},"content":{"rendered":"
Regular readers know I’m a big fan of bookmarklets.\u00a0 I use dozens of them in my desktop and mobile browsers to do things like post links to Delicious <\/em>and Twitter<\/em>, subscribe to feeds in Bloglines<\/em>, expand text-areas and fix unreadable color combinations on websites. I’ve\u00a0written about using bookmarklets in mobile browsers<\/a> here on WapReview and I maintain a small archive of Opera Mini compatible bookmarklets at o.yeswap.com<\/a>. So naturally when Google generously gave me an HTC Evo Android phone at Google I\/O, I wanted to use some of my favorite bookmarklets in Android.<\/p>\n Unfortunately, the Android browser doesn’t support bookmarklets.\u00a0Update<\/strong>: Android 2.2 (Froyo) and latter fully support bookmarklets.\u00a0The problem with older Android versions is that when you try to save a bookmarklet, Android adds “http:\/\/<\/em>” in front of the JavaScript code that is the bookmarklet, breaking it.\u00a0 But I’ve found a bunch of workarounds that let me do most of the things I use\u00a0 bookmarklets for in the Android browser and to even use some real bookmarklets.<\/p>\n <\/p>\n First as most Android users know, there is a Share Page<\/strong><\/em> option in the browser’s menu (image above, left).\u00a0 By default, it lets you share the URL of the current page in an email or text message. It does this by invoking the Android Messaging, Email or Gmail app and passing it the URL.\u00a0 Many third party Android apps also add themselves into the Share menu including the official Facebook app, HTC’s Friend Stream and Peep, the Bluetooth File Transfer app and every Twitter client I’ve used.<\/p>\n There’s one annoying problem with page sharing as it’s implemented in the browser, is that with most apps it\u00a0 only shares the URL. When I’m sharing a link in a Tweet or a text I like to have the message pre-populated with the page title which I use as the basis for descriptive text to include along with the URL.\u00a0 There’s a fix for that in the form of a free app called Share More<\/strong><\/em> (Android Market Link<\/a>)\u00a0 The app has no GUI, it just adds a Share with Title<\/strong><\/em> option (image above, left) to the browser’s share Menu. When clicked it retrieves the page title and then takes you back to the Share menu where you can send the URL plus the title\u00a0 to any browser’s other sharing destinations.<\/p>\n A must have free app for bookmarklet users is\u00a0 Bookmarklet<\/strong><\/em> <\/a>(Android Market Link<\/a>) which lets you add your choice of over 50 predefined pseudo bookmarklets to the browser (image above, right) including Google Translate, Alexa, Digg, Slashdot, Delicious, AIM, Evernote, Friend Feed, Google Buzz, My Space and Read It Latter.\u00a0 You can even add your own bookmarklets using the app.\u00a0 The GUI for adding bookmarklets doesn’t accept JavaScript though and only seems to work with services that expect the URL and optionally the page title to be passed as GET parameters using the\u00a0 “?param=”, &parm=” syntax. I couldn’t get it to work with services that expect slash or semi-colon separated arguments like Bloglines\u00a0 or Dataopedia.com.<\/p>\n For Delicious there’s a great free app named Beelicious<\/a> <\/strong><\/em>(Android Market Link<\/a>) that adds itself to the Share Menu and lets you share page URLs and\u00a0 Titles with the social bookmarking service.\u00a0 Beelicious even maintains a local copy of all the Delicious Tags that you have used and suggests tags as you type (image below, left).<\/p>\n <\/p>\n With Rerware’s MyBookmarks<\/a><\/strong><\/em> (Android Market Link<\/a>) you can actually use real JavaScript bookmarklets in the Android browser. It’s a free Android app that can import all or some of your Firefox, IE or Chrome bookmarks and bookmarklets into the Android browser.\u00a0 To use it you export your desktop browser’s bookmarks to a file. Then run My Bookmarks, which shows you your phone’s device ID (MEID or IMEI). Go to the web form at rerware.com\/MyBookmarks\/<\/a> to enter your device ID and upload your exported bookmarklets file. Back in MyBookmarks on your phone, choose “Import your bookmarks from Rerware.com<\/em>” (image above, right). You have the choice of importing all of them or picking and choosing which ones you want to import.\u00a0 Importing one by one is a bit tedious if you have a lot of bookmarks as you have to respond to a “Add Bookmark? Yes\/No” prompt\u00a0 for every single one (image below, left).\u00a0 If you know your way around HTML is easier to edit the export file to remove unwanted bookmarks before uploading it.<\/p>\n <\/p>\n MyBookmarks seems to import bookmarklets perfectly, but\u00a0 only a small percentage of the ones I imported actually worked.\u00a0 None of my bookmarklets that manipulated the current page to zap colors, replace links with URLs etc. worked. Neither did bookmarklets that used a JavaScript alert to display Page Rank, meta descriptions or cookies. Even\u00a0 most\u00a0 bookmarks that simply open another site and pass the page URL such as\u00a0 a Google Translate bookmarklet didn’t work.\u00a0 The problem seems to be that the browser can’t really handle most bookmarklets. Among other things, it seems to choke on urlencoded characters like %27 (single quote) that are common in bookmarklets. Urlencoding replaces ASCII characters that are illegal in URLs with a “%” followed by the character’s hexadecimal representation.\u00a0 You want to urlencode bookmarklets so that they are valid URLs and can be shared as links on web pages. I was able to fix several of the non-working bookmarklets by editing them\u00a0 in the browser and replacing all occurrences of\u00a0 %27 with single quotes (image above, right).<\/p>\n I really like the Android browser, it’s fast, renders most pages really well, can open new tabs in the background and has some of the best support of any mobile browser for HTML5 features like geolocation, <video> and local storage.\u00a0 But I really wish it handled bookmarklets properly like Mobile IE, Safari, Opera and Symbian 5th Edition WebKit do.\u00a0 The Sharing feature is cool but its limited by the need to install an app for each new sharing target rather than simply adding a JavaScript bookmarklet.<\/p>\n","protected":false},"excerpt":{"rendered":" Regular readers know I’m a big fan of bookmarklets.\u00a0 I use dozens of them in my desktop and mobile browsers to do things like post links to Delicious and Twitter, subscribe to feeds in Bloglines, expand text-areas and fix unreadable color combinations on websites. I’ve\u00a0written about using bookmarklets in mobile browsers here on WapReview and I maintain a small archive of Opera Mini compatible bookmarklets at o.yeswap.com. So naturally when Google generously gave me an HTC Evo Android phone at … Continue reading