Loading editor/html/js/media-browser.js +10 −2 Original line number Diff line number Diff line Loading @@ -110,7 +110,11 @@ var MediaBrowser = (function() { EditorApi.mediaListMedia(connId, albumId).then(function(resp) { var media = resp.media || []; var baseUrl = resp.blogUrl || ''; // Extract just the origin (scheme+host) since URLs are absolute paths var baseUrl = ''; if (resp.blogUrl) { try { baseUrl = new URL(resp.blogUrl).origin; } catch(e) { baseUrl = resp.blogUrl; } } _status.textContent = ''; _grid.innerHTML = ''; Loading Loading @@ -139,8 +143,12 @@ var MediaBrowser = (function() { img.loading = 'lazy'; // Create preview with width=150, height auto-calculated EditorApi.mediaCreatePreview(connId, item.id, 150, 0).then(function(prev) { var prevBase = baseUrl; if (prev.blogUrl) { try { prevBase = new URL(prev.blogUrl).origin; } catch(e) { prevBase = prev.blogUrl; } } if (prev.url) { img.src = (prev.blogUrl || baseUrl) + prev.url; img.src = prevBase + prev.url; } else { img.src = baseUrl + item.url; } Loading Loading
editor/html/js/media-browser.js +10 −2 Original line number Diff line number Diff line Loading @@ -110,7 +110,11 @@ var MediaBrowser = (function() { EditorApi.mediaListMedia(connId, albumId).then(function(resp) { var media = resp.media || []; var baseUrl = resp.blogUrl || ''; // Extract just the origin (scheme+host) since URLs are absolute paths var baseUrl = ''; if (resp.blogUrl) { try { baseUrl = new URL(resp.blogUrl).origin; } catch(e) { baseUrl = resp.blogUrl; } } _status.textContent = ''; _grid.innerHTML = ''; Loading Loading @@ -139,8 +143,12 @@ var MediaBrowser = (function() { img.loading = 'lazy'; // Create preview with width=150, height auto-calculated EditorApi.mediaCreatePreview(connId, item.id, 150, 0).then(function(prev) { var prevBase = baseUrl; if (prev.blogUrl) { try { prevBase = new URL(prev.blogUrl).origin; } catch(e) { prevBase = prev.blogUrl; } } if (prev.url) { img.src = (prev.blogUrl || baseUrl) + prev.url; img.src = prevBase + prev.url; } else { img.src = baseUrl + item.url; } Loading