Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-4586

Exception when trying to call close() on In-App Browser instance

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.0.0
    • None
    • None
    • Tested on Android 4.3 / Nexus 4 and Nexus 10

    Description

      Code sketch:

      var browser = window.open(oauthUrl, '_blank', 'location=yes');
      browser.addEventListener('loadstop', function() {
        if (/* event.url matches the OAuth response URL*/ true) {
          browser.close();
        }
      });
      

      Stack trace from adb logcat.

      W/webview_proxy(27421): 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.
      W/webview_proxy(27421): 	at android.webkit.WebView.checkThread(WebView.java:1918)
      W/webview_proxy(27421): 	at android.webkit.WebView.loadUrl(WebView.java:771)
      W/webview_proxy(27421): 	at org.apache.cordova.core.InAppBrowser.closeDialog(InAppBrowser.java:316)
      W/webview_proxy(27421): 	at org.apache.cordova.core.InAppBrowser.execute(InAppBrowser.java:161)
      W/webview_proxy(27421): 	at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:65)
      W/webview_proxy(27421): 	at org.apache.cordova.PluginManager.execHelper(PluginManager.java:229)
      W/webview_proxy(27421): 	at org.apache.cordova.PluginManager.exec(PluginManager.java:214)
      W/webview_proxy(27421): 	at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:53)
      W/webview_proxy(27421): 	at android.webkit.JWebCoreJavaBridge.sharedTimerFired(Native Method)
      W/webview_proxy(27421): 	at android.webkit.JWebCoreJavaBridge.sharedTimerFired(Native Method)
      W/webview_proxy(27421): 	at android.webkit.JWebCoreJavaBridge.fireSharedTimer(JWebCoreJavaBridge.java:92)
      W/webview_proxy(27421): 	at android.webkit.JWebCoreJavaBridge.handleMessage(JWebCoreJavaBridge.java:108)
      W/webview_proxy(27421): 	at android.os.Handler.dispatchMessage(Handler.java:99)
      W/webview_proxy(27421): 	at android.os.Looper.loop(Looper.java:137)
      W/webview_proxy(27421): 	at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:814)
      W/webview_proxy(27421): 	at java.lang.Thread.run(Thread.java:841)
      W/System.err(27421): 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.
      W/System.err(27421): 	at android.webkit.WebView.checkThread(WebView.java:1927)
      W/System.err(27421): 	at android.webkit.WebView.loadUrl(WebView.java:771)
      W/System.err(27421): 	at org.apache.cordova.core.InAppBrowser.closeDialog(InAppBrowser.java:316)
      W/System.err(27421): 	at org.apache.cordova.core.InAppBrowser.execute(InAppBrowser.java:161)
      W/System.err(27421): 	at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:65)
      W/System.err(27421): 	at org.apache.cordova.PluginManager.execHelper(PluginManager.java:229)
      W/System.err(27421): 	at org.apache.cordova.PluginManager.exec(PluginManager.java:214)
      W/System.err(27421): 	at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:53)
      W/System.err(27421): 	at android.webkit.JWebCoreJavaBridge.sharedTimerFired(Native Method)
      W/System.err(27421): 	at android.webkit.JWebCoreJavaBridge.sharedTimerFired(Native Method)
      W/System.err(27421): 	at android.webkit.JWebCoreJavaBridge.fireSharedTimer(JWebCoreJavaBridge.java:92)
      W/System.err(27421): 	at android.webkit.JWebCoreJavaBridge.handleMessage(JWebCoreJavaBridge.java:108)
      W/System.err(27421): 	at android.os.Handler.dispatchMessage(Handler.java:99)
      W/System.err(27421): 	at android.os.Looper.loop(Looper.java:137)
      W/System.err(27421): 	at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:814)
      W/System.err(27421): 	at java.lang.Thread.run(Thread.java:841)
      W/System.err(27421): 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.
      W/System.err(27421): 	at android.webkit.WebView.checkThread(WebView.java:1918)
      W/System.err(27421): 	... 15 more
      D/dalvikvm(27421): GC_CONCURRENT freed 410K, 5% free 9371K/9808K, paused 2ms+4ms, total 22ms
      W/CordovaPlugin(27421): Attempted to send a second callback for ID: InAppBrowser1475593509
      W/CordovaPlugin(27421): Result was: {"type":"loadstart","url":"http:\/\/about:blank"}
      W/CordovaPlugin(27421): Attempted to send a second callback for ID: InAppBrowser1475593509
      W/CordovaPlugin(27421): Result was: {"type":"exit"}
      W/CordovaPlugin(27421): Attempted to send a second callback for ID: InAppBrowser1475593509
      W/CordovaPlugin(27421): Result was: {"type":"loadstop","url":"about:blank"}
      

      Attachments

        Activity

          People

            bowserj Joey Robert Bowser
            pwnall Victor Costan
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: