Developer Features

iCab Mobile can also be called up from other apps to open specific websites in iCab Mobile or to have certain tasks carried out.

iCab starten

Apps can use the openURL() function of the UIApplication class to let the iOS open a URL in the app that has registered the URL scheme of this URL. The http and https schemes are always forwarded to the default browser (if iCab Mobile is the default browser, iCab Mobile will also open this page). If you want to open a page in iCab Mobile without necessarily being the default browser, you can use the schemes icabmobile and icabmobiles, as well as web and webs instead of http and https (i.e. instead of 'https://apple.com/' you open e.g. 'icabmobiles://apple.com/').

X-Callback-URL

iCab Mobile also supports the X-Callback-URL protocol, which allows an app to pass certain commands to another app via a specially formatted URL and may also return a result as a URL.

A URL that corresponds to the X-Callback-URL protocol is structured as follows:

[scheme]://x-callback-url/[action]?
            [action-parameters]&
            [x-callback-parameters]
The value x-icabmobile must be used for iCab Mobile for [scheme].

[action] defines the command and [action-parameters] defines the parameters associated with the command.

The following commands and parameters are supported by iCab…

Action Required parameters
Optional parameters
Description
addBookmark url=[url]
title=[title]
Saves a bookmark with URL [url] and title [title]
addQuickstarter url=[url]
title=[title]
Adds a bookmark in the quickstarter, with URL [url] and title [title]
addReadingList url=[url]
title=[title]
Adds an entry to the reading list, with URL [url] and title [title]
addSearchEngine url=[url]
title=[title]
Adds the search engine with the name [title] and URL [url] to the list of search engines. The URL should either contain the placeholder '%@', which can be replaced by the search term during the search, or allow the search term to be appended to the end of the URL.
search
searchTerm=[searchTerm]
searchEngine=[searchEngine]
Starts a search with the search term [searchTerm] using the search engine [searchEngine]. If the latter is missing or the specified search engine is unknown, iCab Mobile uses the default search engine.
fullscreen Enables the full screen mode
normalmode Disables the full screen mode
open url=[url]
destination=currentTab
destination=backgroundTab
destination=newTab

fullscreen=yes
fullscreen=no

Opens the website specified by [url], either in the current tab, in a new tab in the foreground or background. The Fullscreen mode can also be optionally activated/deactivated. If you enter 'quickstarter:' in [url], the quickstarter opens.
download url=[url]
filename=[filename]

referrer=[url]

Starts the download from [url] and saves the file under the name [filename] (if specified). Optionally, the referrer can also be specified.

[x-callback-parameters] defines wether a result is sent back to the app that opened the URL in iCab Mobile. If the app does not expect a response, the parameter remains empty. Otherwise, the following return parameters are supported:

Parameter Description
x-success=[url] If successful, iCab opens the URL specified here, which should use the app scheme of the calling app as the URL scheme
x-error=[url] In the event of an error, iCab opens the URL specified here, which should use the app scheme of the calling app as the URL scheme

When building the URL for the X-Callback-URL protocol, please note that parameters must be separated by '&' and encoded using the 'percent-encoding' method

Examples

Open the quick starter in a new tab:
x-icabmobile://x-callback-url/open?
            url=quickstarter:&
            destination=newTab

Opens the iCab-Mobile website in the current tab and in fullscreen mode:

x-icabmobile://x-callback-url/open?
            url=http://www.icab-mobile.de/&
            destination=currentTab&
            fullscreen=yes

Saves the iCab-Mobile page as a bookmark and reports the success or failure back to the app (with URL scheme yourapp)

x-icabmobile://x-callback-url/addBookmark?
            url=http://www.icab-mobile.de/&
            title=iCab%20Mobile%20Homepage&
            x-success=yourapp://success-handler&
            x-error=yourapp://error-hander