mirror of https://github.com/gorhill/uBlock.git
Add support for world/dependencies to external scriplets
To let community better experiment with potential candidate scriptlets for inclusion in uBO itself.
This commit is contained in:
parent
82eee10c3a
commit
695b93f970
|
@ -297,9 +297,23 @@ class RedirectEngine {
|
|||
);
|
||||
this.resources.set(name, RedirectEntry.fromDetails({ mime, data }));
|
||||
if ( Array.isArray(details) ) {
|
||||
const resource = this.resources.get(name);
|
||||
for ( const { prop, value } of details ) {
|
||||
if ( prop !== 'alias' ) { continue; }
|
||||
this.aliases.set(value, name);
|
||||
switch ( prop ) {
|
||||
case 'alias':
|
||||
this.aliases.set(value, name);
|
||||
break;
|
||||
case 'world':
|
||||
if ( /^isolated$/i.test(value) === false ) { break; }
|
||||
resource.world = 'ISOLATED';
|
||||
break;
|
||||
case 'dependency':
|
||||
if ( this.resources.has(value) === false ) { break; }
|
||||
resource.dependencies.push(value);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue