Setting a custom userAgent in HTML or JavaScript

前端 未结 4 1434
野趣味
野趣味 2020-12-17 10:03

Is there any way to do this? I\'m trying to send a GET request to a website, but I want to customize my UserAgent. Is there any way to do this in pure HTML and JavaScript? I

4条回答
  •  醉梦人生
    2020-12-17 10:54

    You will never change a user Agent in HTML, html is the message not messenger.

    Indeed you can do it with a javascript code, but it's dangerous if you ever deploy it in production.

    It's far safer to use an agent switcher:

    https://addons.mozilla.org/fr/firefox/addon/user-agent-switcher/

    https://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg

提交回复
热议问题