You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by Apache Wiki <wi...@apache.org> on 2012/08/09 21:43:20 UTC

[Cordova Wiki] Update of "InAppBrowser" by brianleroux

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Cordova Wiki" for change notification.

The "InAppBrowser" page has been changed by brianleroux:
http://wiki.apache.org/cordova/InAppBrowser

New page:
= InAppBrowser =

Provides the ability to spawn a browser instance from a Cordova application. The API is based on standard browser capability. 

== Declarative API ==

The declarative API is based on the target attribute on anchor elements. 

  || _blank || system browser ||
  || _self || in application browser ||


[1] http://www.w3.org/TR/html401/types.html#type-frame-target

== Programatic API ==

{{{ window.open('local-url.html', '_self'); // loads in CordovaView. _parent and _top same thing }}}
{{{ window.open('local-url.html', '_blank'); // loads in InAppBrowser }}}
{{{ window.open('http://whitelisted-url.com', '_self'); // loads in CordovaView }}}
{{{ window.open('http://whitelisted-url.com', '_blank'); // loads in InAppBrowser }}}
{{{ window.open('http://random-url.com', '_self'); // loads in InAppBrowser }}}
{{{ window.open('http://random-url.com', '_blank'); // native browser }}}

{{{ window.location = 'foo' }}} is equivalent to the '_self' options above.

Local and whitelisted URLs should be opened with Cordova functionality by default (_self) and you have to be explicit if you want those trusted resources opened without Cordova functionality (_blank).