Skip navigation.

exploreopera

| Help

Sign up | Help

Posts tagged with "dontEnum"

In what browser can you enumerate navigator.plugins?

, , ,

I noticed an advertising script using for..in on navigator.plugins. The way that is written causes errors both in Opera and FireFox, so my question of the day is: what browser did they test in? That code can't be targeted at IE, because it has no real support for navigator.plugins.

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!