question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow setting the user agent for HTTP requests

See original GitHub issue

It should be possible to change the User-Agent HTTP header that is included in every WebView and XHR request.

Proposed API: tabris.app.set('userAgent', 'Mozilla/5.0 ...')

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:23 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
cookiegurucommented, Jun 18, 2018

okhttp also supports custom headers, so add images to the list. One possibility would be to set the user-agent at the app level so it trickles down to all types of requests, and possibly default from the package name.

0reactions
cookiegurucommented, Jun 23, 2018

Cordova also has the AppendUserAgent and OverrideUserAgent preferences. Spoiler alert: These are not compatible with Tabris.js 1.x or 2.x. Using these Cordova build properties would be less flexible than being able to modify the user agent at runtime. I can’t think of a situation where it would be necessary to do so, but would rather see these defined on the app object as Cordova is pretty much only used for building and not really defining the capabilities of the built app.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I set the user-agent in the http header - Stack Overflow
User -agent represent your browser like Firefox or Chrome. Use the UserAgent property on HttpWebRequest by casting it to a HttpWebRequest
Read more >
User-Agent - HTTP - MDN Web Docs - Mozilla
The User-Agent request header is a characteristic string that lets servers and network peers identify the application, operating system, vendor ...
Read more >
HTTP headers | User-Agent - GeeksforGeeks
The HTTP headers User-Agent is a request header that allows a characteristic string that allows network protocol peers to identify the ...
Read more >
Set a custom user agent | New Relic Documentation
To set a custom user agent, include an agent string in the HTTP header User-Agent. ... For the integration name, use a string...
Read more >
How to Change User-Agents in Chrome, Edge, Safari & Firefox
A user-agent is an HTTP request header string identifying browsers, applications, or operating systems that connect to the server.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found