开发者

Masquerade/change HTTP_USER_AGENT string permanently using JavaScript?

开发者 https://www.devze.com 2023-02-13 15:05 出处:网络
Is there a way to cha开发者_高级运维nge/modify the value of user-agent string permanently using JavaScript?You mean from a web page inside a browser?

Is there a way to cha开发者_高级运维nge/modify the value of user-agent string permanently using JavaScript?


You mean from a web page inside a browser?

No, definitely not. Neither permanently nor temporarily.


You can't even modify navigator.userAgent (at least on my test with Firefox).

So, no.


Try this.

alert("User-agent header sent: " + navigator.userAgent);
navigator.__defineGetter__('userAgent', function(){ return "Hello" });
alert("User-agent header sent: " + navigator.userAgent);
0

精彩评论

暂无评论...
验证码 换一张
取 消