summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/common/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web_editor/static/src/js/common/utils.js')
-rw-r--r--addons/web_editor/static/src/js/common/utils.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/common/utils.js b/addons/web_editor/static/src/js/common/utils.js
index 6e92bd6955b..8beeca4f26e 100644
--- a/addons/web_editor/static/src/js/common/utils.js
+++ b/addons/web_editor/static/src/js/common/utils.js
@@ -224,6 +224,11 @@ function _getBgImageURL(el) {
if (!match) {
return '';
}
+ const fullURL = new URL(match[2]);
+ // Make URL relative if possible
+ if (fullURL.origin === window.location.origin) {
+ return fullURL.href.slice(fullURL.origin.length);
+ }
return match[2];
}