In what browser can you enumerate navigator.plugins?
Wednesday, 14. September 2005, 18:24:16
If you have a Safari, Konqueror, Mozilla or any 4+ version of Netscape handy, can you tell me what the following bookmarklet says?
javascript:try{for(i in navigator.plugins)navigator.plugins[ i ].description.indexOf('a');alert('Browser passed test');}catch(e){alert('Browser failed test. No description for "'+i+'", but enumerated')}
Thanks!
It did absolutely nothing in Netscape 4.74 and 6.2.
I'm sorry to admit that my preferite browser, Mozilla 1.7.11, has not passed the test (whatever it is). Literally: 'Browser failed test. No description for "lenght", but enumerated'. The Javascript Console shows a warning: reference to undefined property navigator.plugins.description.
Same fail for 'lenght' in Netscape 7.01, but no javascript warning.
By eben2, # 15. September 2005, 00:11:35
By eben2, # 15. September 2005, 00:15:28
I guess an advertising agency using Macs isn't much of a surprise...
By Andrew Gregory, # 15. September 2005, 03:31:54
I'm also surprised to learn that Mozilla 1.7.11 actually writes error messages to the JS console even for code inside try..catch! I can see that it can be useful for developers to do so, but it still seems like very unexpected behaviour.
Time to go contemplate PPK's gems in the first inline script of http://www.quirksmode.org/logo.html again.. :-)
By hallvors, # 15. September 2005, 08:37:11
By qicaispace, # 29. May 2006, 03:33:55