From 28c7ca30be59a5927ebbc9aa0e509e4821f9e6ba Mon Sep 17 00:00:00 2001 From: PengXiao Date: Sat, 20 Feb 2021 09:54:58 +1100 Subject: [PATCH] Fixed URL for Chrome extension. --- src/utils.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/utils.js b/src/utils.js index 1e16106a..1eb6f966 100644 --- a/src/utils.js +++ b/src/utils.js @@ -313,6 +313,13 @@ export function loadJS(src) { return d.promise; } +function getUrl(relativeUrl) { + return chrome.extension + ? chrome.extension.getURL(relativeUrl) + : `${ + location.origin + }${BASE_PATH}/${relativeUrl}` +} /* eslint-disable max-params */ export function getCompleteHtml(html, css, js, item, isForExport) { @@ -326,7 +333,7 @@ export function getCompleteHtml(html, css, js, item, isForExport) { .reduce(function(links, url) { return ( links + - (url ? '\n' : '') + (url ? '\n' : '') ); }, ''); @@ -355,20 +362,16 @@ export function getCompleteHtml(html, css, js, item, isForExport) { '">'; } contents += - ''; + ''; contents += - ''; + ''; contents += - ''; + ''; if (item.jsMode === JsModes.ES6) { contents += ''; }