How to change browser User-Agent Header with javaScript?

后端 未结 2 462
说谎
说谎 2021-01-24 00:20

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

Object.de         


        
2条回答
  •  孤街浪徒
    2021-01-24 00:27

    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)’

提交回复
热议问题