mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
[mv3] Safari does not support resource type object
Need to filter out DNR rules with `object`, otherwise this causes a failure when adding the rules dynamically.
This commit is contained in:
parent
a56e13156f
commit
ef9709fb07
1 changed files with 10 additions and 0 deletions
|
|
@ -33,6 +33,16 @@ const nativeDNR = webext.declarativeNetRequest;
|
|||
const isSupportedRule = r => {
|
||||
if ( r.action?.responseHeaders ) { return false; }
|
||||
if ( r.condition?.tabIds !== undefined ) { return false; }
|
||||
if ( r.condition?.resourceTypes?.includes('object') ) {
|
||||
if ( r.condition.resourceTypes.length === 1 ) { return false; }
|
||||
const i = r.condition.resourceTypes.indexOf('object');
|
||||
r.condition.resourceTypes.splice(i, 1);
|
||||
}
|
||||
if ( r.condition?.excludedResourceTypes?.includes('object') ) {
|
||||
if ( r.condition.excludedResourceTypes.length === 1 ) { return false; }
|
||||
const i = r.condition.excludedResourceTypes.indexOf('object');
|
||||
r.condition.excludedResourceTypes.splice(i, 1);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue