USO bug workaround: generalize getStyleURL()

This commit is contained in:
tophf 2017-06-17 14:55:34 +03:00
parent fba85b36cc
commit 050109428c

View File

@ -129,10 +129,11 @@ new MutationObserver((mutations, observer) => {
function getStyleURL () { function getStyleURL () {
const url = getMeta('stylish-code-chrome'); const url = getMeta('stylish-code-chrome');
// TODO: remove when USO is fixed // TODO: remove when USO is fixed
if (FIREFOX || OPERA || VIVALDI || CHROMIUM) { const directUrl = getMeta('stylish-update-url');
if (directUrl.includes('?') && !url.includes('?')) {
/* get custom settings from the update url */ /* get custom settings from the update url */
return Object.assign(new URL(url), { return Object.assign(new URL(url), {
search: (new URL(getMeta('stylish-update-url'))).search search: (new URL(directUrl)).search
}).href; }).href;
} }
return url; return url;