Almost all apps on the iPhone can easily open a URL in Safari. But normally you can’t open a URL from within Safari in other apps, for example in iCab Mobile (V 1.7).
But with a “bookmarklet” (a special bookmark which is based on JavaScript code) you can do this as well. Here’s how the bookmark URL for the bookmarklet should look like:
javascript:location.href='web'+location.href.substring(4);
Because you can’t create Bookmarks from scratch in Safari on the iPhone, you should just create a bookmark of a random page and change its URL to the above line and the title to “Open in iCab Mobile”.
If you open this bookmarklet from within the Safari bookmarks, the currently displayed web page is passed to iCab Mobile and opened there.
The bookmarklet simply changes the URL scheme from “http” to “web” and from “https” to “webs”. And because iCab Mobile supports the “web” and “webs” schemes as a replacement for “http” and “https”, the iPhone OS will pass these modified URLs to iCab Mobile.
Wonder if some other developers would be amenable to putting an “Open in iCab” link in their apps. I’m really thinking particularly of Twitter apps – Tweetie in particular.
Yes, I hope as well that other developers will do this. I’ve already written the “AppLink” class which other developers can use in their Apps (see the new blog post from today). This new AppLink class makes it very easy to call alternate browsers like iCab Mobile.
So, ot clarify, iCab reserves the scheme “web”? I assume other web browsers should do the same, and so if the user has only one alternative web browser on his iPhone, links to “web:” will open that one. However, if the user has more alternative browsers, either one may “win”. For that reason, I wonder if iCab _also_ does reserver a unique scheme, such as “icab:” (and “icabs:”) so that one can still identifiy iCan in particular if one needs to?
@Thomas
The “web” scheme is used in my “AppLink” proposal and while it is currently used only in iCab Mobile, it should be used by all browsers which are implementing AppLink. So this “web” scheme might not necessarily address only iCab Mobile. But it is unlikely that someone uses multiple (AppLink-aware) browsers on his iPhone permanently at the same time, so in general this shouldn’t be a problem.
iCab Mobile also supports a scheme “icabmobile”, but which is not directly accepting an URL resources specifier as “web” is doing this. The “icabmobile” scheme is currently used by my App “NewsTap” (a Usenet Reader) to open URLs in iCab and to store bookmarks from NewsTap directly in iCab Mobile. Basically the “icabmobile” scheme accepts a general property list, so you can pass any data to iCab Mobile (like Bookmarks which do have a URL and a title and maybe some other additional properties).
But I will extend this scheme so it will also accept a plain URL resource specifier, so with the next release of iCab Mobile you would be able to address iCab Mobile with the following modified scriptlet as well:
javascript:location.href=’icabmobile’+location.href.substring(4);
Hi Alexander,
the first bookmarklet works fine for me. (The second version not yet.)
But I have a wish: I use 1Password on my iPhone for all my passwords etc.
There is a bookmarklet bookmarklet from agilewebsolutions which works together with safari but not with iCab. Can you tell me if I can change the bookmarklet so that it will work with icab too? Or do I have to ask agilewebsolutions to implement that?n
Beste Grüße, Gernot.
@Gernot Schiefer
Where do I find this bookmarklet for 1Password?
I assume this bookmarklet should also work with iCab if all Safari-specific references are exchanged by general references. But I don’t know this bookmarklet, so I don’t know what it is doing.
Hi Alexander,
as far as I understand the bookmarklet of “1Password touch Pro” is:
javascript:window.location=’onepassword://’+window.location
But please check it on the web page http://agilewebsolutions.com/
If you go to http://help.agile.ws/1Password_touch/pro_edition.html
and then click on the video then it will explain the logic of this bookmarklet.
It works fine with Safari and I would be delighted if you can manage to let it work with iCab.
Beste Grüße, Gernot.
@Gernot
The next release of iCab Mobile will also support custom URL schemes of other Apps like 1Password (this should work already, but because of a bug it didn’t). So the 1Password bookmarklet would also work in the next release of iCab Mobile. But I think this doesn’t help yet, because the 1Password app itself would only call Safari and never iCab at the moment. So there’s still some work to do in 1Password in order to use 1Password together with iCab Mobile. But this would not be very hard at all.
Hi Alexander,
yes, the 1Password bookmarklet works with the new version of iCab Mobile – but 1Password only opens Safari.
I will send them an email and ask if they can implement iCab also.
Best wishes, Gernot.
Hi i already use 1password.
Gernot say icab mobile work with icab i try but it didn t work.
Wich version of icab can i use ?
It the only things why i already use safari instead of icab
@Zobi
Sorry, but I’m not really sure what your problem is and what you want to do.
Very i try to make 1password bookmarklet available for icab mobile but it didn t work…
@Zobi
What exactly have you done to create the bookmarklet in iCab Mobile? The 1Password bookmarklet should also work in iCab Mobile. The only problem is that Safari for the Mac has a bug when exporting its bookmarks (Safari forgets to escape quote characters within JavaScript URLs in the exported bookmarks), which makes the bookmarklet invalid. After correcting the errors in the exported bookmarks file, it can be imported in iCab and the bookmarklet should be in iCab as well. You need to replace all occurences of the quote character ” within javascript code of the bookmarklet by “"” in the exported file.
Hi.
I can’t seem to change the bookmark URL in safari. It is greyed out. The title can be changed. Is bookmarklet different to bookmark? I am new to the iPhone. Am I missing something obvious? Loving the icab browser. Thanks.
@Ben
Yes, Safari is a little bit strange. If you add a new Bookmark, Safari does not allow to change the URL. But if you later edit the same Bookmark (tap on the “Edit” button in the bookmarks list and then tap on the Bookmark entry), you can change the URL.
Thanks for the tip. It works perfectly.
Hi!
I realized when using the scheme web:// or icabmobile:// iCab mobile on iPhone and iPad opens the url in an existing tab, causing the previous loaded website to be “overwritten”. This especially is annoying because history isn’t saved and you can’t go back — so the website is lost forever, if you don’t remember what you’ve been visiting before :/
…is there a setting I missed to tell iCab mobile to open incoming URL in a new tab?
@Jacob
In the settings app of the device, you’ll find some additional settings for iCab Mobile. And here there’s a switch to let other Apps open URLs in new Tabs.
@Alexander
Ah, great! Thanks for the support and a really great Browser