[Project_owners] Event.button in Firefox 1.5.0.2

Nickolay Ponomarev asqueella at gmail.com
Sun May 14 16:11:43 EDT 2006


On 5/14/06, Didier Ernotte <didier at ernotte.com> wrote:
> I have corrected it in a rush with this
>
>     var leftButton = 0;
>     if ((navigator.userAgent.indexOf("rv:1.8.0.2") == -1) &&
> (navigator.userAgent.indexOf("rv:1.8.0.3") == -1))
>     {
>         leftButton = ((navigator.userAgent.indexOf("Firefox/1.0+") ==
> -1) &&
>                       (navigator.userAgent.indexOf("Firefox/1.4") ==
> -1) &&
>                       (navigator.userAgent.indexOf("Firefox/1.5") ==
> -1) &&
>                       (navigator.userAgent.indexOf("Thunderbird/1.5")
> == -1) &&
>                       (navigator.userAgent.indexOf("SeaMonkey") == -1)
> &&
>                       (navigator.userAgent.indexOf("rv:1.9") == -1) &&
>                       (navigator.userAgent.indexOf("rv:1.8") == -1)) ?
> 0 : 65535;
>     }
>     if ((event.button == leftButton) && (event.ctrlKey == false))
>     {
>      ...
>     }
>
>
User agent string checks suck, use nsIXULAppInfo:
http://developer.mozilla.org/en/docs/Using_nsIXULAppInfo

Nickolay


More information about the Project_owners mailing list