From 0034dcb9414977fb4e058342c16b6d4fd801bcd6 Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 12 Oct 2021 20:26:57 +0300 Subject: [PATCH] preserve installationUrl --- background/style-manager.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/background/style-manager.js b/background/style-manager.js index 9a92d2ff..b0e3b649 100644 --- a/background/style-manager.js +++ b/background/style-manager.js @@ -512,13 +512,16 @@ const styleMan = (() => { res = style.md5Url = url.replace('update.update.userstyles', 'update.userstyles'); } /* Default homepage URL for external styles installed from a known distro */ - if ((url = style.updateUrl) && (url = - URLS.extractGreasyForkInstallUrl(url) || - URLS.extractUsoArchiveInstallUrl(url) || - URLS.extractUSwInstallUrl(url) - )) { + if ( + (!style.url || !style.installationUrl) && + (url = style.updateUrl) && + (url = URLS.extractGreasyForkInstallUrl(url) || + URLS.extractUsoArchiveInstallUrl(url) || + URLS.extractUSwInstallUrl(url) + ) + ) { if (!style.url) res = style.url = url; - if (style.installationUrl !== url) res = style.installationUrl = url; + if (!style.installationUrl) res = style.installationUrl = url; } return Boolean(res); }