mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-15 07:22:28 +02:00
Fix broken alias nostif
Related feedback: -ba11a70013 (r45030152)
Regression from: -ba11a70013
This commit is contained in:
parent
c41be5b828
commit
24755d4300
@ -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 New Issue
Block a user