From 93e6b08e7c8fca959482a55f7314df48077d6403 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 17 Jun 2015 16:53:21 +0200 Subject: [PATCH] [FIX] website: Edition with Firefox with CSS of external domains. Firefox doesn't allow to access sheets cssRules In such a case, we just pass, these css rules will simply not be available for the edition of some inputs. Probably, when a real use case needing these external css rules will come, we will probably need to fetch these style sheets another way. opw-642752 --- addons/website/static/src/js/website.editor.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index 12dceabac8f..2d52d045280 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -2185,7 +2185,11 @@ define(['summernote/summernote'], function () { } var sheets = document.styleSheets; for(var i = 0; i < sheets.length; i++) { - var rules = sheets[i].rules || sheets[i].cssRules; + try { + var rules = sheets[i].rules || sheets[i].cssRules; + } catch(e) { + continue; + } if (rules) { for(var r = 0; r < rules.length; r++) { var selectorText = rules[r].selectorText;