From 7cf27601ae7c6ce5b617b5b5e971b2756ca0df8b Mon Sep 17 00:00:00 2001 From: tophf Date: Sat, 30 Sep 2017 03:01:07 +0300 Subject: [PATCH] popup: USO workaround for finding extension styles --- popup.html | 3 ++- popup/popup.js | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/popup.html b/popup.html index 022a15ff..fb0899eb 100644 --- a/popup.html +++ b/popup.html @@ -114,7 +114,8 @@
- +
diff --git a/popup/popup.js b/popup/popup.js index 093d2478..462ce74b 100644 --- a/popup/popup.js +++ b/popup/popup.js @@ -74,7 +74,6 @@ function initPopup(url) { }; setupLivePrefs(); - $('#find-styles-link').onclick = handleEvent.openURLandHide; Object.assign($('#popup-manage-button'), { onclick: handleEvent.openManager, onmouseup: handleEvent.openManager, @@ -96,10 +95,11 @@ function initPopup(url) { installed); } - // find styles link - $('#find-styles a').href = - 'https://userstyles.org/styles/browse/all/' + - encodeURIComponent(url.startsWith('file:') ? 'file:' : url); + $('#find-styles-link').onclick = handleEvent.openURLandHide; + $('#find-styles-link').href += + url.startsWith(location.protocol) ? + '?search_terms=Stylus' : + 'all/' + encodeURIComponent(url.startsWith('file:') ? 'file:' : url); if (!url) { document.body.classList.add('blocked');