So I am working on a project that access a discord bot using a token in web browsers But recently, discord has changed their policy of bot requests, that make us have to manually change the user agent setting in the developer tools. Now I am wondering that is there any way that I can override the user agent setting of browser in JavaScript or HTML?
I have tried the method at here
For instance, after pasting the code:
setUserAgent(window, "BDP (http://example.com), v0.0.1)");
And it seems that it no loger work so I tried again with this
For instance:
Object.defineProperty(navigator, 'userAgent', {
get: function () { return 'BDP (http://example.com), v0.0.1)'; }
});
But none of the method above helps me. Is there any way that I can override the user agent of browser?
Thanks!