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