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, 3 insertions, 2 deletions
diff --git a/addons/web_editor/static/src/js/common/utils.js b/addons/web_editor/static/src/js/common/utils.js
index 8beeca4f26e..b4ffdc4b3af 100644
--- a/addons/web_editor/static/src/js/common/utils.js
+++ b/addons/web_editor/static/src/js/common/utils.js
@@ -224,12 +224,13 @@ function _getBgImageURL(el) {
if (!match) {
return '';
}
- const fullURL = new URL(match[2]);
+ const matchedURL = match[2];
// Make URL relative if possible
+ const fullURL = new URL(matchedURL, window.location.origin);
if (fullURL.origin === window.location.origin) {
return fullURL.href.slice(fullURL.origin.length);
}
- return match[2];
+ return matchedURL;
}
return {