How can I spoof my userAgent using a userscript?

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 …