diff --git a/content/install-hook-userstyles.js b/content/install-hook-userstyles.js index c9002c23..2eb9aca2 100644 --- a/content/install-hook-userstyles.js +++ b/content/install-hook-userstyles.js @@ -280,7 +280,8 @@ document.documentElement.appendChild(document.createElement('script')).text = '( document.currentScript.remove(); document.addEventListener('stylusFixBuggyUSOsettings', function _({detail}) { document.removeEventListener('stylusFixBuggyUSOsettings', _); - settings = /\?/.test(detail) && new URLSearchParams(new URL(detail).search); + // TODO: remove .replace(/^\?/, '') when minimum_chrome_version >= 52 (https://crbug.com/601425) + settings = /\?/.test(detail) && new URLSearchParams(new URL(detail).search.replace(/^\?/, '')); if (!settings) { Response.prototype.json = originalResponseJson; } diff --git a/edit/edit.js b/edit/edit.js index 0fb746c5..b8070f42 100644 --- a/edit/edit.js +++ b/edit/edit.js @@ -1336,7 +1336,8 @@ function beautify(event) { } function initStyleData() { - const params = new URLSearchParams(location.search); + // TODO: remove .replace(/^\?/, '') when minimum_chrome_version >= 52 (https://crbug.com/601425) + const params = new URLSearchParams(location.search.replace(/^\?/, '')); const id = params.get('id'); const createEmptyStyle = () => ({ id: null, diff --git a/install-usercss/install-usercss.js b/install-usercss/install-usercss.js index ede62830..13a7739c 100644 --- a/install-usercss/install-usercss.js +++ b/install-usercss/install-usercss.js @@ -3,7 +3,8 @@ 'use strict'; (() => { - const params = new URLSearchParams(location.search); + // TODO: remove .replace(/^\?/, '') when minimum_chrome_version >= 52 (https://crbug.com/601425) + const params = new URLSearchParams(location.search.replace(/^\?/, '')); let liveReload = false; let installed = false; diff --git a/manage/filters.js b/manage/filters.js index 088abd90..d7282e7f 100644 --- a/manage/filters.js +++ b/manage/filters.js @@ -8,7 +8,8 @@ const filtersSelector = { numTotal: 0, }; -const urlFilterParam = new URLSearchParams(location.search).get('url'); +// TODO: remove .replace(/^\?/, '') when minimum_chrome_version >= 52 (https://crbug.com/601425) +const urlFilterParam = new URLSearchParams(location.search.replace(/^\?/, '')).get('url'); if (location.search) { history.replaceState(0, document.title, location.origin + location.pathname); }