mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
[mv3] Fix dnr-parser for Safari compatibility
This commit is contained in:
parent
6221cecf57
commit
c142d9af67
2 changed files with 18 additions and 4 deletions
|
|
@ -245,6 +245,8 @@ function getAutocompleteCandidates(from) {
|
|||
{ token: 'urlFilter:', after: ' ' },
|
||||
{ token: 'initiatorDomains:', after: '\n - ' },
|
||||
{ token: 'excludedInitiatorDomains:', after: '\n - ' },
|
||||
{ token: 'domains:', after: '\n - ' },
|
||||
{ token: 'excludedDomains:', after: '\n - ' },
|
||||
{ token: 'requestDomains:', after: '\n - ' },
|
||||
{ token: 'excludedRequestDomains:', after: '\n - ' },
|
||||
{ token: 'resourceTypes:', after: '\n - ' },
|
||||
|
|
|
|||
|
|
@ -294,12 +294,14 @@ const perScopeParsers = {
|
|||
rule.condition.urlFilter = val;
|
||||
break;
|
||||
case 'initiatorDomains':
|
||||
rule.condition.initiatorDomains = [];
|
||||
scope.push('initiatorDomains');
|
||||
case 'domains':
|
||||
rule.condition[key] = [];
|
||||
scope.push(key);
|
||||
break;
|
||||
case 'excludedInitiatorDomains':
|
||||
rule.condition.excludedInitiatorDomains = [];
|
||||
scope.push('excludedInitiatorDomains');
|
||||
case 'excludedDomains':
|
||||
rule.condition[key] = [];
|
||||
scope.push(key);
|
||||
break;
|
||||
case 'requestDomains':
|
||||
rule.condition.requestDomains = [];
|
||||
|
|
@ -348,6 +350,16 @@ const perScopeParsers = {
|
|||
rule.condition.excludedInitiatorDomains.push(node.val);
|
||||
return true;
|
||||
},
|
||||
'condition.domains': function(scope, rule, node) {
|
||||
if ( node.list !== true ) { return false; }
|
||||
rule.condition.domains.push(node.val);
|
||||
return true;
|
||||
},
|
||||
'condition.excludedDomains': function(scope, rule, node) {
|
||||
if ( node.list !== true ) { return false; }
|
||||
rule.condition.excludedDomains.push(node.val);
|
||||
return true;
|
||||
},
|
||||
'condition.requestDomains': function(scope, rule, node) {
|
||||
if ( node.list !== true ) { return false; }
|
||||
rule.condition.requestDomains.push(node.val);
|
||||
|
|
|
|||
Loading…
Reference in a new issue