WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 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 3 years ago.
20012.user_can_richedit.diff (508 bytes) - added by georgestephanis 3 years ago.
Patch version with conditional moved to user_can_richedit

Download all attachments as: .zip

Change History (13)

@georgestephanis3 years ago

comment:1 @SergeyBiryukov3 years ago

  • Milestone changed from Awaiting Review to 3.4

comment:2 @nacin3 years ago

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

I'll test and commit this over the weekend.

comment:3 @ocean903 years ago

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

comment:4 @georgestephanis3 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.

comment:5 @ocean903 years ago

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

@georgestephanis3 years ago

Patch version with conditional moved to user_can_richedit

comment:6 follow-up: @georgestephanis3 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.

comment:7 in reply to: ↑ 6 @nacin3 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.

comment:8 @nacin3 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.

comment:9 @nacin3 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.

comment:10 @nacin3 years ago

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

comment:11 @azaozz3 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.