Bookmarklets in mobile browsers
Last year I started to implement the “Add Bookmark” feature for the mobile browsers using a bookmarklet, the same way as in the desktop browsers, but soon ran into 2 issues.
Issue with mobile Safari on iPhone
If you tapped on the “Add to Ninja” bookmarklet the “Add Bookmark” window opened behind the active browser window. I tried everything, there was no way to bring it to the front. I spent a lot of time with trying to understand why it works this way then finally found a weird workaround: if I added a 1.1 second delay before opening the window, then it came to the front. Adding a 1.0 second delay didn’t work, only 1.1 seconds or higher. This seemed to be a kind of a timing issue in Safari.
Issue with mobile Chrome
After you created the bookmarklet with the above described copy/paste method, the bookmarklet was not accessible anymore, it disappeared from the browser’s favorites list. This meant that you couldn’t invoke the “Add Bookmark” window by tapping on the bookmarklet. I searched the net and it turned out that that this is “as designed”. In mobile Chrome you have to run a bookmarklet in a different way: start typing its name in the browser’s address field, suggestions of bookmarks/bookmarklets will popup, then tap on the bookmarklet you want to run.
This really sucks
Let’s see what we have on mobile devices:
- In Safari you have to wait for the “Add Bookmark” window more than 1 second after you tapped on the bookmarklet
- In Chrome you have to start typing the name of the bookmarklet (“Add to Ninja”) to access and to tap on the bookmarklet
I think #1 (the bookmarklet installation) is kind of acceptable, you have to do it only once. But #2 and #3 can definitely lead to bad user experience. The whole thing sucks especially if you consider that Safari and Chrome are the 2 most used browsers on mobile devices. Finally I decided not to release the bookmarklet version of the “Add Bookmark” feature on mobile, rather I implemented the “email sending” version: in the mobile browser you tap on share, then email the website to a dedicated email address to add the link to Bookmark Ninja. But this lacks the possibility to set the category and to add tags. But at least it works decently.
One year later
A year later I decided to develop native mobile apps to get around the mobile browser bookmarklet problems. I already wrote about my adventure with Swift and Xcode, this was not a successful attempt, either. Then I started to think about how I could get the maximum out from the mobile bookmarklet mess. And then came the pleasant surprise: a year later both the Safari and Chrome issues were fixed, everything worked as expected! Wow!
Last week the mobile bookmarklet support in Bookmark Ninja went live. I’m happy that finally the bookmarklet version has been implemented over the native mobile app, because the former one is much easier to maintain and it also runs faster than a mobile share extension app.
Thank you Google and Apple for the fixes!