cavzhw
Last Updated: February 25, 2016
·
110
· zecho
Avatar500

Fix the browser's appName with this secret trick

Isn't it weird how when you type window.navigator.appName into the Chrome Dev Tools that it returns with "Netscape"?

That's pretty weird, right? We can fix that.

But first let's see what Mozilla Developer Network has to say about the appName property.

appName is the name of the browser as a string.

So, since I'm the person browsing, this is correct:

window.navigator.appName = "Zac";

You should obviously put your own name in there, but here's a cool way to set it for all the users of your web page.

var browser = prompt( 'Enter your name, pal!' );
window.navigator.appName = browser;

Now when you check window.navigator.appName it will return with "Netscape", which is correct.

Say Thanks
Respond

1 Response
Add your response

19506
D42a7264714dee5006b9c99d2567a320

+1 for the use of prompt

over 1 year ago ·