Is there a way to get the Windows username in Google Chrome using JavaScript?

I want to get the OS username with cross-browser JavaScript. I tried different solutions for this, but none actually worked. I really don't want to install a third party plugin as per my requirement I cannot do it.

This is so far I get on the internet while surfing for a solution

    var wshshell = new ActiveXObject("wscript.shell");
    var username = wshshell.ExpandEnvironmentStrings("%username%");
    alert(username);

      

+3
javascript


source to share


No one has answered this question yet

Check out similar questions:

5101
What's the most efficient way to deeply clone an object in JavaScript?
3796
How do you get the timestamp in JavaScript?
2853
Get the current url using JavaScript?
2701
How do I get the values โ€‹โ€‹of a query string in JavaScript?
2102
How do I get the current date in JavaScript?
1904
Get the size of the screen, current web page and browser window
1895
Open the url in a new tab (not a new window) using JavaScript
1566
Get selected value in dropdown using JavaScript
1012
(Inline) way in JavaScript to check if a string is a valid number
871
Get the current year in JavaScript



All Articles
Loading...
X
Show
Funny
Dev
Pics