mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 09:07:54 +01:00
Fix broken alias nostif
Related feedback: -ba11a70013 (r45030152)
Regression from: -ba11a70013
This commit is contained in:
parent
c41be5b828
commit
24755d4300
1 changed files with 7 additions and 4 deletions
|
@ -375,11 +375,11 @@ RedirectEngine.prototype.resourcesFromString = function(text) {
|
|||
|
||||
if ( line.startsWith('/// ') ) {
|
||||
if ( details === undefined ) {
|
||||
details = {};
|
||||
details = [];
|
||||
}
|
||||
const [ prop, value ] = line.slice(4).trim().split(/\s+/);
|
||||
if ( value !== undefined ) {
|
||||
details[prop] = value;
|
||||
details.push({ prop, value });
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -401,8 +401,11 @@ RedirectEngine.prototype.resourcesFromString = function(text) {
|
|||
RedirectEntry.fromContent(mime, content)
|
||||
);
|
||||
|
||||
if ( details instanceof Object && details.alias ) {
|
||||
this.aliases.set(details.alias, name);
|
||||
if ( Array.isArray(details) ) {
|
||||
for ( const { prop, value } of details ) {
|
||||
if ( prop !== 'alias' ) { continue; }
|
||||
this.aliases.set(value, name);
|
||||
}
|
||||
}
|
||||
|
||||
fields = undefined;
|
||||
|
|
Loading…
Reference in a new issue