Skip to content
Snippets Groups Projects
Commit c0da01c7 authored by David Monjoie's avatar David Monjoie
Browse files

[FIX] web_editor: fix ClipboardJS traceback in Firefox 109

Starting with Firefox 109, a widget element prototype that is put
inside an iframe will not be instanceof its original constructor.
See: https://github.com/webcompat/web-bugs/issues/118350

This is because a node that is adopted by an iframe will have its
prototype changed to match the constructor from within the iframe
instead of its original one. This has been the case for a long time.
See: https://bugzilla.mozilla.org/show_bug.cgi?id=1470017

It largely went unnoticed because of another quirk of Firefox related
to the use of instanceof which was fixed in version 109.
See: https://bugzilla.mozilla.org/show_bug.cgi?id=1360715



Since this bug was fixed it became apparent, in the form of a
traceback, that the wrong instance of ClipboardJS was being used
in the case of Firefox, due to the forced prototype change.

This commit could be reverted once Firefox is fixed.

Steps to reproduce the issue in Firefox > 109:
- Create a new mass mailing.
- Choose the third template with "Thank you for joining us!".
- Click on the "LOGIN" button link inside the email.
- Get a traceback about a paremeter not being the right type.

Task-3186513
OPW-3172914

closes odoo/odoo#120003

Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
Co-authored-by: default avatarJinjiu Liu <jili@odoo.com>
Co-authored-by: default avatarDavid Monjoie <dmo@odoo.com>
parent 790b80a4
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment