[Greasemonkey] FF1.5b, Gm0.6.x, new Option(String) fails?

Matthias Bauer ml-greasemonkey-42imk83y at moeffju.net
Wed Oct 19 22:38:45 EDT 2005


On 19.10.2005 18:48 Jeremy Dunck wrote:

>>> the following code:
>>>
>>>   var o = new Option('foo');
(and also a simple 'var o = new Option()')

> Strange.  This is not speced anywhere, right?  Just de facto standard?

DevGuru[1] and sun.com[2], among some other web sources[3], give the
constructor as:

  new Option([text[, value[, defaultSelected[, selected]]]])

> Works OK in 1.0.7.
> 
> Additional data points: new unsafeWindow.Option() also does not work.

It also works from the JavaScript Shell, the location bar, and 'normal'
sites (both HTML and XHTML). I'm guessing it has something to do with
the sandboxing?

-Matt

References:
1: http://www.devguru.com/Technologies/ecmascript/quickref/option.html
2: http://docs.sun.com/source/816-6408-10/option.htm
3: google javascript option constructor


More information about the Greasemonkey mailing list