unbork installer, regressed in 81a5acfd
This commit is contained in:
parent
2e021f6ac9
commit
225a2cec31
|
@ -154,9 +154,11 @@
|
||||||
|
|
||||||
/** @param {chrome.webRequest.WebRequestBodyDetails} req */
|
/** @param {chrome.webRequest.WebRequestBodyDetails} req */
|
||||||
function openNamedStyle(req) {
|
function openNamedStyle(req) {
|
||||||
|
if (!req.url.includes('?')) { // skipping our usercss installer
|
||||||
chrome.tabs.update(req.tabId, {url: 'edit.html?id=' + req.url.split('#')[1]});
|
chrome.tabs.update(req.tabId, {url: 'edit.html?id=' + req.url.split('#')[1]});
|
||||||
return {cancel: true};
|
return {cancel: true};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function req2key(req) {
|
function req2key(req) {
|
||||||
return req.tabId + ':' + req.frameId;
|
return req.tabId + ':' + req.frameId;
|
||||||
|
|
|
@ -158,7 +158,7 @@ window.StyleInjector = window.INJECTED === 1 ? window.StyleInjector : ({
|
||||||
function setTextAndName(el, {id, code = '', name}) {
|
function setTextAndName(el, {id, code = '', name}) {
|
||||||
if (exposeStyleName && name) {
|
if (exposeStyleName && name) {
|
||||||
el.dataset.name = 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} */`;
|
code += `\n/*# sourceURL=${chrome.runtime.getURL(name)}.user.css#${id} */`;
|
||||||
}
|
}
|
||||||
el.textContent = code;
|
el.textContent = code;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user