cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-4858) Android InAppBrowser does not function properly on 4.3
Date Thu, 10 Oct 2013 16:41:41 GMT

    [ https://issues.apache.org/jira/browse/CB-4858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13791653#comment-13791653
] 

ASF subversion and git services commented on CB-4858:
-----------------------------------------------------

Commit 8a6bc01814b6d7eb3f605ad47a45d33163153a66 in branch refs/heads/dev from [~agrieve]
[ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-inappbrowser.git;h=8a6bc01 ]

CB-4858 Convert relative URLs to absolute URLs in JS


> Android InAppBrowser does not function properly on 4.3
> ------------------------------------------------------
>
>                 Key: CB-4858
>                 URL: https://issues.apache.org/jira/browse/CB-4858
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, Plugin InAppBrowser
>    Affects Versions: 3.0.0
>         Environment: Android 4.3
>            Reporter: Marcus Pridham
>            Assignee: Andrew Grieve
>
> Try using the full example for the executeScript on a 4.3 emulator.
> http://cordova.apache.org/docs/en/3.0.0/cordova_inappbrowser_inappbrowser.md.html#executeScript
> You will get a syntax issue around the replaceHeaderImage function it is missing a };
at the end of the executeScript call.
> Correct function should look like:
> {code}
>     function replaceHeaderImage() {
>         iabRef.executeScript({
>             code: "var img=document.querySelector('#header img'); img.src='http://cordova.apache.org/images/cordova_bot.png';"
>         }, function() {
>             alert("Image Element Successfully Hijacked");
>         });
>     }
> {code}
> Anyway if you run this sample it will fail on a 4.3 emulator with the following stack
trace but it will work fine on a 4.0 emulator.
> {code}
> 09-17 15:45:34.236: W/webview_proxy(2553): java.lang.Throwable: Warning: A WebView method
was called on thread 'WebViewCoreThread'. All WebView methods must be called on the UI thread.
Future versions of WebView may not support use on other threads.
> 09-17 15:45:34.236: W/webview_proxy(2553): 	at android.webkit.WebView.checkThread(WebView.java:1918)
> 09-17 15:45:34.236: W/webview_proxy(2553): 	at android.webkit.WebView.loadUrl(WebView.java:771)
> 09-17 15:45:34.236: W/webview_proxy(2553): 	at org.apache.cordova.inappbrowser.InAppBrowser.injectDeferredObject(InAppBrowser.java:245)
> 09-17 15:45:34.236: W/webview_proxy(2553): 	at org.apache.cordova.inappbrowser.InAppBrowser.execute(InAppBrowser.java:169)
> 09-17 15:45:34.236: W/webview_proxy(2553): 	at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:65)
> 09-17 15:45:34.236: W/webview_proxy(2553): 	at org.apache.cordova.PluginManager.execHelper(PluginManager.java:229)
> 09-17 15:45:34.236: W/webview_proxy(2553): 	at org.apache.cordova.PluginManager.exec(PluginManager.java:214)
> 09-17 15:45:34.236: W/webview_proxy(2553): 	at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:53)
> 09-17 15:45:34.236: W/webview_proxy(2553): 	at android.webkit.JWebCoreJavaBridge.setNetworkOnLine(Native
Method)
> 09-17 15:45:34.236: W/webview_proxy(2553): 	at android.webkit.JWebCoreJavaBridge.setNetworkOnLine(Native
Method)
> 09-17 15:45:34.236: W/webview_proxy(2553): 	at android.webkit.WebViewCore$EventHub$1.handleMessage(WebViewCore.java:1431)
> 09-17 15:45:34.236: W/webview_proxy(2553): 	at android.os.Handler.dispatchMessage(Handler.java:99)
> 09-17 15:45:34.236: W/webview_proxy(2553): 	at android.os.Looper.loop(Looper.java:137)
> 09-17 15:45:34.236: W/webview_proxy(2553): 	at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:814)
> 09-17 15:45:34.236: W/webview_proxy(2553): 	at java.lang.Thread.run(Thread.java:841)
> 09-17 15:45:34.236: W/System.err(2553): java.lang.RuntimeException: java.lang.Throwable:
Warning: A WebView method was called on thread 'WebViewCoreThread'. All WebView methods must
be called on the UI thread. Future versions of WebView may not support use on other threads.
> 09-17 15:45:34.246: W/System.err(2553): 	at android.webkit.WebView.checkThread(WebView.java:1927)
> 09-17 15:45:34.246: W/System.err(2553): 	at android.webkit.WebView.loadUrl(WebView.java:771)
> 09-17 15:45:34.246: W/System.err(2553): 	at org.apache.cordova.inappbrowser.InAppBrowser.injectDeferredObject(InAppBrowser.java:245)
> 09-17 15:45:34.246: W/System.err(2553): 	at org.apache.cordova.inappbrowser.InAppBrowser.execute(InAppBrowser.java:169)
> 09-17 15:45:34.246: W/System.err(2553): 	at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:65)
> 09-17 15:45:34.246: W/System.err(2553): 	at org.apache.cordova.PluginManager.execHelper(PluginManager.java:229)
> 09-17 15:45:34.246: W/System.err(2553): 	at org.apache.cordova.PluginManager.exec(PluginManager.java:214)
> 09-17 15:45:34.246: W/System.err(2553): 	at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:53)
> 09-17 15:45:34.246: W/System.err(2553): 	at android.webkit.JWebCoreJavaBridge.setNetworkOnLine(Native
Method)
> 09-17 15:45:34.246: W/System.err(2553): 	at android.webkit.JWebCoreJavaBridge.setNetworkOnLine(Native
Method)
> 09-17 15:45:34.246: W/System.err(2553): 	at android.webkit.WebViewCore$EventHub$1.handleMessage(WebViewCore.java:1431)
> 09-17 15:45:34.246: W/System.err(2553): 	at android.os.Handler.dispatchMessage(Handler.java:99)
> 09-17 15:45:34.246: W/System.err(2553): 	at android.os.Looper.loop(Looper.java:137)
> 09-17 15:45:34.246: W/System.err(2553): 	at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:814)
> 09-17 15:45:34.246: W/System.err(2553): 	at java.lang.Thread.run(Thread.java:841)
> 09-17 15:45:34.246: W/System.err(2553): Caused by: java.lang.Throwable: Warning: A WebView
method was called on thread 'WebViewCoreThread'. All WebView methods must be called on the
UI thread. Future versions of WebView may not support use on other threads.
> 09-17 15:45:34.246: W/System.err(2553): 	at android.webkit.WebView.checkThread(WebView.java:1918)
> 09-17 15:45:34.246: W/System.err(2553): 	... 14 more
> {code}
> This is related to CB-4586 but is by no means a minor issue.  The Android InAppBrowser
code needs to run all webview methods on the UI thread now.
> Here are web thread related issues:
> 1.  Loading a relative url will fail in the InAppBrowser because the updateUrl method
is calling webView.getUrl() outside the UI thread.
> 2.  Execute script will fail because injectDeferredObject is calling inAppWebView.loadUrl
outside the UI thread.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message