Opened 15 years ago

Closed 15 years ago

#4160 closed Bug (invalid)

Firefox WinXP 3.5.1: Seeing "Your browser is not compatible with CKEditor" error

Reported by: blumunky Owned by:
Priority: Normal Milestone:
Component: General Version: 3.0 RC
Keywords: WorksForMe Cc:

Description

I'm using Firefox 3.5.1 on Windows XP Pro SP2

I'm seeing the "Your browser is not compatible with CKEditor..." error when I visit any of the RC3 demos or the nightly 4016 demos

However, all of the fckeditor v2 demos work

After some digging, it appears that the problem might be that my browser is reporting a browser agent of:

"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2"

In env.js, the following line 135:

version = geckoRelease[0] * 10000 + ( geckoRelease[1] || 0 ) * 100 + ( geckoRelease[2] || 0 ) * 1;

Converts this rv string into a gecko version of 10800 which at line 178:

env.isCompatible =
  ( env.ie && version >= 6 ) ||
  ( env.gecko && version >= 10801 ) ||
  ( env.opera && version >= 9.5 ) ||
  ( env.air && version >= 1 ) ||
  ( env.webkit && version >= 522 ) ||
  false; 

Causes isCompatible to become false;

This issue is that the code is assuming that the first digit in the rv is the 10000s place. I certainly don't know why this decision was made or whether or not my proposed change will break something else, but here goes:

I propose that in env.js, line 135 be changed to:

for(var mult=1,ii=geckoRelease.length-1;ii>=0;ii--,mult*=10) {
  version += (mult * geckoRelease[ii]);
}

This will convert an rv of 1.8.0.2 into a gecko version of 1802. This of course means that all instances where a gecko version of 10xxx is expected will need to be changed. I changed the following instances:

env.js line 185:

( env.gecko && version >= 10801 ) ||

became

( env.gecko && version >= 1801 ) ||

editor.js line 141

if ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 && editor.lang.dir == 'rtl' )

became

if ( CKEDITOR.env.gecko && CKEDITOR.env.version < 1900 && editor.lang.dir == 'rtl' )

plugins\button\plugin.js line 238, plugins\plugin.js line 562, and plugins\elementspath\plugin.js line 95

if ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 )

became

if ( CKEDITOR.env.gecko && CKEDITOR.env.version < 1900 )

Making these changes fixed the problem for me.

Change History (2)

comment:1 Changed 15 years ago by Frederico Caldeira Knabben

Keywords: WorksForMe added

How can if be that your browser is reporting the user agent string as Firefox 1.5?

CKEditor is compatible (for now) with Firefox 2.0, which uses Gecko (revision) 1.8.1, which is converted to 10801 for comparison. So, our code looks correct, and your user agent string wrong. We must just understand why.

comment:2 Changed 15 years ago by Alfonso Martínez de Lizarrondo

Resolution: invalid
Status: newclosed

That's basically a problem in the Firefox profile. Due to any reason like the User Agent Switcher extension, the reported UA is wrong, so obviously the detection will fail.

There's no reason to change the code at all, because for other people the UA might report Firefox 1.0 or Explorer 6 or whatever.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy