workaround for URLSearchParams not stripping "?" in chrome 49-51
This commit is contained in:
parent
a64dc26dd7
commit
bf13383c93
|
@ -280,7 +280,8 @@ document.documentElement.appendChild(document.createElement('script')).text = '(
|
||||||
document.currentScript.remove();
|
document.currentScript.remove();
|
||||||
document.addEventListener('stylusFixBuggyUSOsettings', function _({detail}) {
|
document.addEventListener('stylusFixBuggyUSOsettings', function _({detail}) {
|
||||||
document.removeEventListener('stylusFixBuggyUSOsettings', _);
|
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) {
|
if (!settings) {
|
||||||
Response.prototype.json = originalResponseJson;
|
Response.prototype.json = originalResponseJson;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1336,7 +1336,8 @@ function beautify(event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function initStyleData() {
|
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 id = params.get('id');
|
||||||
const createEmptyStyle = () => ({
|
const createEmptyStyle = () => ({
|
||||||
id: null,
|
id: null,
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
'use strict';
|
'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 liveReload = false;
|
||||||
let installed = false;
|
let installed = false;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,8 @@ const filtersSelector = {
|
||||||
numTotal: 0,
|
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) {
|
if (location.search) {
|
||||||
history.replaceState(0, document.title, location.origin + location.pathname);
|
history.replaceState(0, document.title, location.origin + location.pathname);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user