I'm trying to visit a website but its not allowing me to do so because it doesn't support my browser. I believe it is detecting my browser through userAgent detection. So I wanted to create a userScript that would modify my userAgent so that the website wouldn't be able to detect my browser. I tried:
// ==UserScript==
// @name Change UserAgent
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Spoofs the userAgent
// @author You
// @include *
// @run-at document-start
// ==/UserScript==
Object.defineProperty(navigator, 'userAgent', {
value: "MyCustomUserAgent",
configurable: false
});
Even though it shows for me that the userAgent is a custom value, I believe the request for the userAgent is being done before I can spoof it. Is there any way in which I can do so without using an extension? Thank you.