Skip to content Skip to sidebar Skip to footer

How To Change Browser User-agent Header With Javascript?

Following code changes property printed (when accessed through javaScript) by browser console and not the actual Use-Agent string sent with the header. Object.defineProperty(naviga

Solution 1:

This is now possible to do, see: https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name You can use ‘ XMLHttpRequest.setRequestHeader(User-Agent, value)’

Solution 2:

This isn't possible from the page itself. The user agent string (as sent in the HTTP request headers) can only be changed via browser extension or browser configuration.

Post a Comment for "How To Change Browser User-agent Header With Javascript?"