android - How can you imitate a (specific) browser when using a webview? -
in app use webview open website. on website there javascript causes error. now, know website uses browser detection , believe might problem why page appears blank page in webview.
is there way somehow imitate browser if js tries detect browser not fail?
here webviewclient:
settings.setjavascriptenabled(true); settings.setdomstorageenabled(true); webview.setscrollbarstyle(webview.scrollbars_outside_overlay); webview.setwebviewclient(new webviewclient() { @override public boolean shouldoverrideurlloading(webview view, string url) { log.i(tag, "processing webview url click..."); view.loadurl(url); return true; } @override public void onpagefinished(webview view, string url) { log.i(tag, "finished loading url: " + url); } @override public void onreceivederror(webview view, int errorcode, string description, string failingurl) { log.e(tag, "error: " + description); } @override public void onreceivedsslerror(webview view, sslerrorhandler handler, sslerror error) { log.i(tag, "ssl error:" + error); handler.proceed(); } });
webview.getsettings().setuseragentstring(<set browser namestring>);
the above setting might you. might case useragentstring
set browser type well
Comments
Post a Comment