WordPress.org

Make WordPress Core

#20012 closed defect (bug) (fixed)

Disable TinyMCE in wp_editor for the Amazon Silk browser -- which doesn't support it

Reported by: georgestephanis Owned by: nacin
Priority: normal Milestone: 3.4
Component: Editor Version: 3.3.1
Severity: normal Keywords: tableteers has-patch
Cc:

Description

Patch attached. Simply turns off WYSIWYG editor in the Silk Browser, as the Silk Browser doesn't support the contentEditable attribute, which is necessary for TinyMCE to function (same issue with CKEditor etc)

Attachments (2)

20012.diff (654 bytes) - added by georgestephanis 17 months ago.
20012.user_can_richedit.diff (508 bytes) - added by georgestephanis 17 months ago.
Patch version with conditional moved to user_can_richedit

Download all attachments as: .zip

Change History (13)

georgestephanis17 months ago

comment:1 SergeyBiryukov17 months ago

  • Milestone changed from Awaiting Review to 3.4

comment:2 nacin17 months ago

  • Owner set to nacin
  • Status changed from new to accepted

I'll test and commit this over the weekend.

comment:3 ocean9017 months ago

Isn't user_can_richedit() the better place for this?

comment:4 georgestephanis17 months ago

It's not a user setting, though. It's a test for whether it will work in the current browser. Conceptually, I think it belongs where it is.

comment:5 ocean9017 months ago

Take a look into the function, it checks the browser type too.

georgestephanis17 months ago

Patch version with conditional moved to user_can_richedit

comment:6 follow-up: georgestephanis17 months ago

I added this where I did in the user_can_richedit() function as we really will want to turn it off for front-end use for logged out users as well. If someone uses it in their theme, it's useless to generate a wysiwyg box on the silk as it's impossible to enter content to it.

comment:7 in reply to: ↑ 6 nacin16 months ago

Replying to georgestephanis:

I added this where I did in the user_can_richedit() function as we really will want to turn it off for front-end use for logged out users as well. If someone uses it in their theme, it's useless to generate a wysiwyg box on the silk as it's impossible to enter content to it.

Check the conditional again -- it runs when a user isn't logged in as well. It simply can't count on get_user_option() when the user is logged out.

I tested this, made some tweaks to how it got worked into user_can_richedit(). I also confirmed that it does not matter if Silk acceleration is turned off — TinyMCE doesn't work there, either.

comment:8 nacin16 months ago

I'm also going to make an assumption, one we might need to change before 3.4 is released, depending on research in the area.

The webkit build 534 pushed us into TinyMCE territory for iOS 5. Silk is at 533. If I had to take a guess, the next release of the Kindle Fire (expected in March) might just update to a build that pushes us over the edge. So, I'm coding it so at 534, it gets kicked on for Silk too.

comment:9 nacin16 months ago

In [19936]:

Don't try to load the visual editor for Amazon's Silk browser (Kindle Fire), as it doesn't work. Add in a sunrise clause for WebKit build 534. see #20012.

comment:10 nacin16 months ago

I know I rewrote that, but I meant to give props to georgestephanis. Sorry.

comment:11 azaozz15 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

Seems to be working well.

Note: See TracTickets for help on using tickets.