View any password behind the asterix

To view passwords behind asterisk(********), just open the web page having the password. After opening the web
page paste the javascript given below in the address bar and hit enter. That’s it.
javascript:(function(){var s,F,j,f,i; s = ""; F = document.forms; for(j=0; j<F.length; ++j) { f = F[j]; for (i=0; i<f.length; ++i) { if (f[i].type.toLowerCase() == "password") s += f[i].value + "\n"; } } if (s) alert("Passwords in forms on this page:\n\n" + s); else alert("There are no passwords in forms on this page.");})();
Or if you can somehow get a friend to type their password,
you can quickly paste this code and see it!