Fix: limit the scope of styleViaAPI
This commit is contained in:
parent
a026ccfb0b
commit
323103f55a
|
@ -202,18 +202,20 @@ const APPLY = (() => {
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyOnMessage(request) {
|
function applyOnMessage(request) {
|
||||||
if (request.method === 'ping') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (STYLE_VIA_API) {
|
if (STYLE_VIA_API) {
|
||||||
if (request.method === 'urlChanged') {
|
if (request.method === 'urlChanged') {
|
||||||
request.method = 'styleReplaceAll';
|
request.method = 'styleReplaceAll';
|
||||||
}
|
}
|
||||||
API.styleViaAPI(request);
|
if (/^(style|updateCount)/.test(request.method)) {
|
||||||
return;
|
API.styleViaAPI(request);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (request.method) {
|
switch (request.method) {
|
||||||
|
case 'ping':
|
||||||
|
return true;
|
||||||
|
|
||||||
case 'styleDeleted':
|
case 'styleDeleted':
|
||||||
styleInjector.remove(request.style.id);
|
styleInjector.remove(request.style.id);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user