Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1055] Android: Expose ability to set user agent for webview instances

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-11-08T23:47:56.000+0000
Affected Version/sRelease 1.7.3
Fix Version/sRelease 1.8.0
ComponentsAndroid
Labelsmodule_webview, qe-testadded
ReporterJeff Haynie
AssigneeHieu Pham
Created2011-04-15T02:42:43.000+0000
Updated2013-11-25T08:48:57.000+0000

Description

http://developer.appcelerator.com/question/30341/android-webview-useragent"> http://developer.appcelerator.com/question/30341/android-webview-us...

Comments

  1. Biztactix 2011-04-15

    I was talking to someone who mentioned this shouldn't be difficult as it exists in Android, it's just a matter of adding as passthrough setting for Titanium.
    This would allow us to wrap alot of iPhone only sites up.

  2. Marshall Culpepper 2011-10-24

    To test this we can just verify a default user agent and try replacing it with our own, i.e.:
       var win = Ti.UI.createWindow({ top: 0, left: 0, right: 0, bottom: 0 });
       var webview = Ti.UI.createWebView({ url: 'http://www.google.com' });
       win.add(webview);
       win.open();
       
       Ti.API.debug(webview.getUserAgent());
       webview.setUserAgent("custom user agent");
       
       Ti.API.debug("should be custom user agent: " + webview.getUserAgent());
       
       
  3. Marshall Culpepper 2011-11-02

    We have 2 pull requests currently pending for this that need to be merged post-V8: [https://github.com/appcelerator/titanium_mobile/pull/407] [https://github.com/appcelerator/titanium_mobile/pull/583]
  4. Michael Pettiford 2012-02-08

    Closing issue Tested with Ti Studio build 1.0.8.201201262211 Ti Mob SDK 1.9.0.v20120207171634 OSX Lion 10.7.2 Nexus S OS 2.3.6 Verified that setting a custom user agent works as expected as per Marshall's test case
  5. jithinpv 2013-11-25

    Anvil test case added. PR link: https://github.com/appcelerator/titanium_mobile/pull/5020

JSON Source