WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#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
Milestone: 3.4 Priority: normal
Severity: normal Version: 3.3.1
Component: Editor Keywords: tableteers has-patch
Focuses: 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 4 years ago.
20012.user_can_richedit.diff (508 bytes) - added by georgestephanis 4 years ago.
Patch version with conditional moved to user_can_richedit

Download all attachments as: .zip

Change History (13)

#1 @SergeyBiryukov
4 years ago

  • Milestone changed from Awaiting Review to 3.4

#2 @nacin
4 years ago

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

I'll test and commit this over the weekend.

#3 @ocean90
4 years ago

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

#4 @georgestephanis
4 years 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.

#5 @ocean90
4 years ago

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

@georgestephanis
4 years ago

Patch version with conditional moved to user_can_richedit

#6 follow-up: @georgestephanis
4 years 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.

#7 in reply to: ↑ 6 @nacin
4 years 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.

#8 @nacin
4 years 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.

#9 @nacin
4 years 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.

#10 @nacin
4 years ago

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

#11 @azaozz
4 years ago

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

Seems to be working well.

Note: See TracTickets for help on using tickets.