CKEditor doesn't show up due to useragent rejection

This board is for discussions, bug reports, etc. for pre-releases of the v27 milestone codenamed "Tycho".

Since the beta phase is over, this board is closed for new posts/topics.
Locked
User avatar
WouterK
Moongazer
Moongazer
Posts: 14
Joined: 2016-01-08, 11:43
Location: The Netherlands

CKEditor doesn't show up due to useragent rejection

Post by WouterK » 2016-09-08, 18:49

At my own (Drupal-based) website, Tycho Alpha 2 doesn't display the CKEditor toolbar (4.5.10 = latest version),
whereas PM 26.4.0 does. (Compare the two attached screenshots.)
The latest versions of Firefox, Chrome and IE 11 show the toolbar too.

The reason CKEditor rejects Tycho turns out to be Tycho's useragent string:

Code: Select all

Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:3.0) Gecko/20100101 Goanna/20160728 PaleMoon/27.0.0a2
However, with an override for my website set to PM 26.4.0's useragent, Tycho does display the toolbar:

Code: Select all

Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:38.9) Gecko/20100101 Goanna/2.1 Firefox/38.9 PaleMoon/26.4.0
Comparing the two, my first thought was that CKEditor needs "Firefox/38.9", but adding that to Tycho's string doesn't help.
What does help, is raising "rv:3.0" to "rv:4.0" or higher.

In fact, I think I've found the code rejecting rv 3.0 in ckeditor.js:

Code: Select all

b.isCompatible=!(b.ie&&7>c)&&!(b.gecko&&4E4>c)&&!(b.webkit&&534>c)
When I temporarily changed !(b.gecko&&4E4>c) to !(b.gecko&&3E4>c), the toolbar reappeared.

I don't know the reason why rv was lowered to 3.0 in Tycho, but I think it breaks all instances of CKEditor.

Sorry for bringing up yet another of those horrid useragent headaches...
Attachments
Pale Moon 26.4.0 showing CKEditor toolbar
Pale Moon 26.4.0 showing CKEditor toolbar
Tycho Alpha 2 not showing CKEditor toolbar
Tycho Alpha 2 not showing CKEditor toolbar

User avatar
New Tobin Paradigm
Knows the dark side
Knows the dark side
Posts: 9284
Joined: 2012-10-09, 19:37
Location: Seriphia Galaxy

Re: CKEditor doesn't show up due to useragent rejection

Post by New Tobin Paradigm » 2016-09-10, 10:16

Our rv: version tries to be as accurate as possible to our actual engine version.

However, we have enhanced, extended, and unified the UA compatibility options to a simple tri-mode preference.
options.png
Try Firefox compatibility from the drop down. That will give you the most compatibility with UA sniffing for Firefox.

Code: Select all

Native: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:3.0) Goanna/20160909 PaleMoon/27.0.0a2
Gecko: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:3.0) Gecko/20100101 Goanna/20160909 PaleMoon/27.0.0a2
Firefox: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:45.9) Gecko/20100101 Goanna/3.0 Firefox/45.9 PaleMoon/27.0.0a2
Though, I don't know why you believe this is a problem with us.. This is obviously a deficiency in CKEditor and one easily resolved on their side as you have so effectively demonstrated.
You know I have the greatest enthusiasm possible for the mission.
Image

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 29675
Joined: 2011-08-28, 17:27
Location: Tranås, SE
Contact:

Re: CKEditor doesn't show up due to useragent rejection

Post by Moonchild » 2016-09-10, 10:32

This should be brought up with the CKEditor people and fixed on their side. they should remove this ancient check since Firefox with a Gecko version < 4 is not something you should even consider in your scripting anymore. And if people still use FF 3.5 (Gecko 1.9), then that is entirely on them. Still, if CKEditor devs want to keep this check for archaic compatibility reasons, it should simply be changed to "if less than 2" because in Gecko land, v2.0 and above is FF4+.
"Son, in life you do not fight battles because you expect to win, you fight them merely because they need to be fought." -- Snagglepuss
Image

Locked