diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js index 54df499c5b0..26c19a6367c 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -7127,6 +7127,11 @@ registry.BackgroundShape = SnippetOptionWidget.extend({ this._lastShapePalette = palette; this._shapeBackgroundImagePerClass = {}; for (const styleSheet of this.$target[0].ownerDocument.styleSheets) { + if (styleSheet.href && new URL(styleSheet.href).host !== location.host) { + // In some browsers, if a stylesheet is loaded from a different domain + // accessing cssRules results in a SecurityError. + continue; + } for (const rule of [...styleSheet.cssRules]) { if (rule.selectorText && rule.selectorText.startsWith(".o_we_shape.")) { this._shapeBackgroundImagePerClass[rule.selectorText] = rule.style.backgroundImage;