View Full Version : [FIXED-269][3.x] EventManager Issue with Useragent in SrWare-Iron

25 Sep 2009, 8:17 AM
Hi Folks,
found a glitch in the 3.0 Code from SVN (Last Update a few days ago).

In the Event Manager Code (Event-Manager-more.js)
theres a regexp fired against the user-agent like that:

useKeydown = Ext.isSafari ?
Ext.num(navigator.userAgent.toLowerCase().match(/version\/(\d+\.\d)/)[1] || 2) >= 3.1 :
!((Ext.isGecko && !Ext.isWindows) || Ext.isOpera);

This fails, as in Srware Iron (a Google Chrome Fork w/o the Google Stuff) the User-Agent doesn't contain the String "version".

SrWare Iron for sure isn't a popular browser, and i didn't bother to install Google Chrome only to test this,

but i think it should by fixed anyway cause
a) accessing the .match()[1] without checking it is unsafe anyway and
b) this little glitch causes our whole app to not load /work in Iron.

27 Sep 2009, 9:33 AM
I'm assuming Iron still does not report a correct user agent string:

but i guess it would make sense to future-proof it in case even Safari's useragent strings start to go funky (plus the fact that Iron currently isn't / will probably never be an officially supported browser):

Ext.apply(Ext.EventManager, {
useKeydown: Ext.isSafari?
Ext.num((navigator.userAgent.toLowerCase().match(/version\/(\d+\.\d)/) || [])[1] || 2) >= 3.1 :
!((Ext.isGecko && !Ext.isWindows) || Ext.isOpera);

27 Sep 2009, 6:59 PM
I would agree that it's not a bug since it isn't on the supported browser list. However we can actually make the check shorter and more generic.

Fix applied to svn in rev #5422 for patch release 3.0.3.

13 Oct 2009, 4:17 AM
The Iron browser is great, and I wanted my extjs apps to run in this browser.
In fact extjs recognizes it as Safari, which causes the Problem.

There is a bug in the browser: You can set the userAgent with an ua.ini file - but this does not seem to affect javascript calls to navigator.userAgent :(

As this browser is just a chrome, a simple fix could be (3.0.0)


isChrome = check(/chrome/)||check(/iron/),

That worked for me.