[Greasemonkey] Greasemonkey 0.6.6
Henrik Nyh
henrik at nyh.se
Wed Oct 18 12:18:47 PDT 2006
Lenny Domnitser wrote:
> On 10/18/06, Henrik Nyh <henrik at nyh.se> wrote:
>> :D Well, any numbers could be parsed out before comparisons, e.g. you
>> could do "1.1 - Ducky", "1.2 - Jello pudding". and compare those.
>
> You can just compare the string. "1.2" > "1.1", "2006-10-18" >
> "2006-10-17", and "Jello pudding" > "Ducky". (Really.
> javascript:%22Jello%20pudding%22%3E%22Ducky%22 )
Sure, but e.g.
javascript:alert("10" < "2")
evaluates to true. ;)
I think the simplest and most useful thing would be to only consider
values containing some numerical value (and parsing out that value,
comparing it as a number). Other values are ignored, as though there was
no value specified.
I don't feel strongly at all about it, but I don't see that it'd be
worth the effort to also support strings, dates or whatever. Then you'd
also have to define how e.g. strings should compare to numbers. It seems
both (1<"foo") and (1>"foo") evaluate to false.
--
Henrik Nyh
http://henrik.nyh.se
More information about the Greasemonkey
mailing list