javascript - Android webview local html auto redirect to browser -
i'm trying automatically redirect local html file in android web-view browser window when cookie read. javascript below opens url in web-view need open in separate browser instead.
onload=function(){ document.getelementbyid('linksnewwindow').checked = readcookie('linksnewwindow')==1? true : false; if(document.getelementbyid('linksnewwindow').checked = readcookie('linksnewwindow')== true){ location.href = "url"; } }
the code android app calls local html file webview
if (android.os.build.version.release.startswith("4.4.2")) { string localurl = "file:///android_asset/splash/splashkitkat.html"; webview.getsettings().setjavascriptenabled(true); webview.loadurl(localurl); }
i'm not sure if little issue javascript or bigger if help me out great. in advance
you can utilize javasctipt-java bridge , phone call android code custom html javascript within webview. android code may launch intent external browser. see more call java function javascript on android webview
javascript android html webview
No comments:
Post a Comment