From f337e185155c65cc24b3c6943472bd45e075557a Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 6 Dec 2017 22:35:19 +0300 Subject: [PATCH] recognize usercss @updateURL * installation URL is preferred - same behavior as before * @updateURL is used when the style was drag'n'dropped into the manage page because there's no real URL in this case * install-usercss page shows the new update URL, which is set as per the above, under the checkbox that enables updates --- background/usercss-helper.js | 4 +- install-usercss.html | 1 + install-usercss/install-usercss.css | 11 +++ install-usercss/install-usercss.js | 26 +++--- js/usercss.js | 120 +++++++++++++++------------- 5 files changed, 92 insertions(+), 70 deletions(-) diff --git a/background/usercss-helper.js b/background/usercss-helper.js index 4d5a4be9..a114e9c5 100644 --- a/background/usercss-helper.js +++ b/background/usercss-helper.js @@ -78,8 +78,8 @@ var usercssHelper = (() => { ); } - function openInstallPage(tab, {url = tab.url, direct} = {}) { - if (direct) { + function openInstallPage(tab, {url = tab.url, direct, downloaded} = {}) { + if (direct && !downloaded) { prefetchCodeForInstallation(tab.id, url); } return wrapReject(openURL({ diff --git a/install-usercss.html b/install-usercss.html index 24affbf9..ea900b20 100644 --- a/install-usercss.html +++ b/install-usercss.html @@ -64,6 +64,7 @@ +