From 212a1dcd8a818bdedc3164d949a02f665e795bc3 Mon Sep 17 00:00:00 2001 From: tophf Date: Fri, 15 Nov 2024 15:58:14 +0300 Subject: [PATCH] fix: show real url for relative externals --- src/background/utils/db.js | 3 ++- src/common/ui/externals.vue | 24 ++++++++++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/background/utils/db.js b/src/background/utils/db.js index f22dd10303..85eb674ab0 100644 --- a/src/background/utils/db.js +++ b/src/background/utils/db.js @@ -687,7 +687,8 @@ export async function parseScript(src) { if (!getScriptHome(script) && isRemote(src.from)) { script.custom.homepageURL = src.from; } - if (isRemote(src.url)) script.custom.lastInstallURL = src.url; + // Allowing any http url including localhost as the user may keep multiple scripts there + if (isValidHttpUrl(src.url)) script.custom.lastInstallURL = src.url; script.custom.tags = script.custom.tags?.split(/\s+/).map(normalizeTag).filter(Boolean).join(' ').toLowerCase(); if (!srcUpdate) storage.mod.remove(getScriptUpdateUrl(script, { all: true }) || []); buildPathMap(script, src.url); diff --git a/src/common/ui/externals.vue b/src/common/ui/externals.vue index bb1c5f2a69..15ae3fce15 100644 --- a/src/common/ui/externals.vue +++ b/src/common/ui/externals.vue @@ -3,7 +3,7 @@
-
- +
@@ -40,7 +40,8 @@