Skip to content
uupaa edited this page Oct 15, 2015 · 6 revisions

Namespace

Spec exists into the WebModule namespace. see: publish to global

API

WebIntent.build

WebIntent.build(packageName:PackageNameString, url:URLString, action:ActionString = "android.intent.action.VIEW"):WebIntentURLString は、インテント用の URL を生成し返します。

  • packageName には、Google Play で利用できるパッケージ名を指定します
    • "com.example.app" のような形式になります
  • url にはリダイレクト先のアプリで開きたい(開き直したい)ページの URL を指定します
    • 現在のページを Chrome で開き直すには url に location.href を指定します

詳細を知りたい方は、Android Intents with Chrome を参照してください。

    // # Open the page of Caniuse.com in Chrome for Android.
    var packageName = "com.android.chrome";               // Chrome for Android package name
    var url         = "http://caniuse.com/#search=webgl"; // Caniuse.com
    var intentURL   = WebIntent.build(packageName, url);

    WebIntent.redirect( intentURL );

WebIntent.redirect

WebIntent.redirect(intentURL:WebIntentURLString):void は、intentURL でリダイレクトを行います。

Clone this wiki locally