yui rich text editor problem
with the last update, firefox quantum (version 57) the YUI rich text editor does not work anymore. I have reported the problem in a lot of our intranet reserved webapp, but you can test and reproduce the bug on this independent url (not under our control)
http://yui.github.io/yui2/docs/yui_2.9.0_full/examples/editor/simple_adv_editor.html
All Replies (3)
Hi,
I'm able to reproduce this problem in Firefox as well. What's happening is that apparently when this library was written, the authors added special code for Firefox to work around a bug that was happening in Firefox 2 (which is from 2011). If you're interested, the specific code is here: https://github.com/yui/yui2/blob/067c9f82ecc90e4b392b7cb06a4a4f7fe3f6136e/src/editor/js/simple-editor.js#L1078 . This code uses a feature unique to Firefox that was disabled in Firefox 57 for increased security (https://blog.mozilla.org/security/2017/10/04/treating-data-urls-unique-origins-firefox-57/) . As a result, the editor is no longer working in Firefox.
You should be able to work around this by installing an addon like User-Agent switcher. Using the settings in this Addon, you can trick the text editor into thinking you're using another browser (like Chrome or Safari), which will make the text editor stop using the special workaround for Firefox. Let me know if this works!
The people who run your website should be able to fix this problem fairly easily by patching YUI's browser detection code. If you direct them to this thread, I can provide directions on how to do that.
Can you gently inform me how to patch the code for firefox 57?
With regards
Sure! What you want to do is change the browser-detection code linked above to also detect Firefox, so that YUI will use the first code path instead of the second one. I think if you change this:
if (this.browser.ie || this.browser.webkit || this.browser.opera || (navigator.userAgent.indexOf('Firefox/1.5') != -1)) {
to this:
if (this.browser.ie || this.browser.webkit || this.browser.opera || this.browser.gecko) {
then it should work. Let me know if it doesn't.