keep valid url path chars intact

This commit is contained in:
tophf 2022-07-30 20:48:43 +03:00
parent 079e7e50f1
commit 7a1045b45a

View File

@ -158,7 +158,7 @@ window.StyleInjector = window.INJECTED === 1 ? window.StyleInjector : ({
function setTextAndName(el, {id, code = '', name}) {
if (exposeStyleName && name) {
el.dataset.name = name;
name = encodeURIComponent(name.replace(/[?#%/@:']/g, toSafeChar));
name = encodeURIComponent(name.replace(/[?#/']/g, toSafeChar));
code += `\n/*# sourceURL=${chrome.runtime.getURL(name)}.user.css#${id} */`;
}
el.textContent = code;