Skip to content
Snippets Groups Projects
Commit 8c6c1fac authored by Anh Thao Pham (pta)'s avatar Anh Thao Pham (pta)
Browse files

[FIX] web_editor: prevent editing document in iframe with cross-origin access issue


- Go to Email Marketing
- Create a new mailing with template having social media links
- Save
- Click on one of the social links
An error is triggered:
"Error: Blocked a frame with origin xxx from accessing a cross-origin frame."

The traceback occurs because we try to change the content of something we
don't have access to, as these sites prevent display in an iframe.

opw-2599540

closes odoo/odoo#79188

X-original-commit: 9702e541
Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
parent 4f641de3
No related branches found
No related tags found
No related merge requests found
......@@ -327,6 +327,11 @@ var FieldHtml = basic_fields.DebouncedField.extend(TranslatableFieldMixin, {
return;
}
var cwindow = self.$iframe[0].contentWindow;
try {
cwindow.document;
} catch (e) {
return;
}
cwindow.document
.open("text/html", "replace")
.write(
......
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