Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-17139

Android: Ti.UI.WebView.setUserAgent() breaks HTML selection

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Low
    • Resolution: Won't Fix
    • Affects Version/s: Release 5.0.2
    • Fix Version/s: None
    • Component/s: Android
    • Labels:
    • Environment:

      TitaniumSDK 5.0.2.GA
      Google Nexus 6 - 5.1.0

      Description

      Issue description

      The Titanium Android app below sets the user-agent on a WebView, so the web server can differentiate the Android app from the Android browser. When setUserAgent is used, touching an HTML select will no longer open the input on the bottom of the screen.

      app.js

      var tabGroup = Ti.UI.createTabGroup({ exitOnClose: true });
          var webView = Titanium.UI.createWebView();
          webView.setUrl('select.html');
       
          // removing the setUserAgent fixes the HTML select
          webView.setUserAgent('Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; SAMSUNG-SGH-I747 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30');
       
          var window = Titanium.UI.createWindow();
          window.add(webView);
          var adviceTab = Ti.UI.createTab({
              title : "Title",
              window : window
          });
          window.containingTab = adviceTab;
          tabGroup.addTab(adviceTab);
          tabGroup.open();
      

      select.html

      <!DOCTYPE html>
      <html>
      <head>
      <title>Testing options</title>
      </head>
      <body>
      <select>
      <option>one</option>
      <option>two</option>
      <option>three</option>
      </select>
      </body>
      </html>
      

      Stack trace

      -- Start application log -----------------------------------------------------
      [INFO] :   TiApplication: (main) [1,1] checkpoint, app created.
      [INFO] :   TiApplication: (main) [36,37] Titanium 5.0.2 (2015/09/30 12:07 92c2265)
      [INFO] :   TiApplication: (main) [18,55] Titanium Javascript runtime: v8
      [INFO] :   TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
      [WARN] :   V8Object: (KrollRuntimeThread) [387,387] Runtime disposed, cannot set property 'userAgent'
      [INFO] :   TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.appc.test.AndroidserviceActivity@208e5400
      [DEBUG] :  OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
      [DEBUG] :  D/        : HostConnection::get() New Host Connection established 0xb3ecede0, tid 7052
      [DEBUG] :  Atlas: Validating map...
      [DEBUG] :  libEGL: loaded /system/lib/egl/libEGL_emulation.so
      [DEBUG] :  libEGL: loaded /system/lib/egl/libGLESv1_CM_emulation.so
      [DEBUG] :  libEGL: loaded /system/lib/egl/libGLESv2_emulation.so
      [DEBUG] :  D/        : HostConnection::get() New Host Connection established 0xaec39840, tid 7077
      [INFO] :   OpenGLRenderer: Initialized EGL, version 1.4
      [DEBUG] :  OpenGLRenderer: Enabling debug mode 0
      [WARN] :   EGL_emulation: eglSurfaceAttrib not implemented
      [WARN] :   OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xaec35c60, error=EGL_SUCCESS
      [TRACE] :  updating tiapp metadata with Appcelerator Platform...
      [DEBUG] :  TabGroup: Checkpoint: postTabGroupCreated()
      [INFO] :   WebViewFactory: Loading com.android.webview version 39 (eng.buildbot-x86) (code 399997)
      [INFO] :   LibraryLoader: Time to load native libraries: 3 ms (timestamps 1967-1970)
      [INFO] :   LibraryLoader: Expected native library version number "",actual native library version number ""
      [TRACE] :  WebViewChromiumFactoryProvider: Binding Chromium to main looper Looper (main, tid 1) {136e5b52}
      [INFO] :   LibraryLoader: Expected native library version number "",actual native library version number ""
      [INFO] :   chromium: [INFO:library_loader_hooks.cc(104)] Chromium logging enabled: level = 0, default verbosity = 0
      [INFO] :   BrowserStartupController: Initializing chromium process, singleProcess=true
      [WARN] :   art: Attempt to remove local handle scope entry from IRT, ignoring
      [WARN] :   chromium: [WARNING:resource_bundle.cc(304)] locale_file_path.empty()
      [INFO] :   chromium: [INFO:aw_browser_main_parts.cc(65)] Load from apk succesful, fd=47 off=46184 len=3037
      [INFO] :   chromium: [INFO:aw_browser_main_parts.cc(78)] Loading webviewchromium.pak from, fd:48 off:229484 len:1089587
      [ERROR] :  BluetoothAdapter: Bluetooth binder is null
      [TRACE] :  Uploaded tiapp metadata with Appcelerator Platform!
      [WARN] :   chromium: [WARNING:mailbox_synchronizer.cc(41)] MailboxSync not supported due to missing EGL image/fence support
      [WARN] :   chromium: [WARNING:data_reduction_proxy_settings.cc(331)] SPDY proxy OFF at startup
      [WARN] :   art: Attempt to remove local handle scope entry from IRT, ignoring
      [WARN] :   AwContents: onDetachedFromWindow called when already detached. Ignoring
      [WARN] :   art: Attempt to remove local handle scope entry from IRT, ignoring
      [WARN] :   art: Attempt to remove local handle scope entry from IRT, ignoring
      [WARN] :   art: Attempt to remove local handle scope entry from IRT, ignoring
      [WARN] :   art: Attempt to remove local handle scope entry from IRT, ignoring
      [WARN] :   art: Attempt to remove local handle scope entry from IRT, ignoring
      [WARN] :   art: Attempt to remove local handle scope entry from IRT, ignoring
      [WARN] :   EGL_emulation: eglSurfaceAttrib not implemented
      [WARN] :   OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xaec35c80, error=EGL_SUCCESS
      [INFO] :   Choreographer: Skipped 47 frames!  The application may be doing too much work on its main thread.
      [INFO] :   Choreographer: Skipped 40 frames!  The application may be doing too much work on its main thread.
      [ERROR] :  chromium: [ERROR:buffer_manager.cc(313)] [.Parent-Compositor-0xaee39a90]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
      [INFO] :   Choreographer: Skipped 40 frames!  The application may be doing too much work on its main thread.
      [INFO] :   Choreographer: Skipped 50 frames!  The application may be doing too much work on its main thread.
      [INFO] :   Choreographer: Skipped 53 frames!  The application may be doing too much work on its main thread.
      [INFO] :   Choreographer: Skipped 34 frames!  The application may be doing too much work on its main thread.
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ssombhatla Srikanth Sombhatla (Inactive)
                Reporter:
                mspivey Matthew Spivey
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-18837
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code