Skip to content

Commit

Permalink
Fix regression breaking import of file:// lists
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Apr 9, 2024
1 parent d4a99a9 commit c223a8c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/js/3p-filters.js
Expand Up @@ -559,21 +559,20 @@ const selectFilterLists = async ( ) => {
const textarea = qs$('#lists .listEntry[data-role="import"].expanded textarea');
if ( textarea === null ) { return ''; }
const lists = listsetDetails.available;
const lines = textarea.value.split(/\s+\n|\s+/);
const lines = textarea.value.split(/\s+/);
const after = [];
for ( const line of lines ) {
after.push(line);
if ( /^https?:\/\//.test(line) === false ) { continue; }
for ( const [ listkey, list ] of Object.entries(lists) ) {
if ( list.content !== 'filters' ) { continue; }
if ( list.contentURL === undefined ) { continue; }
if ( list.contentURL.includes(line) === false ) {
after.push(line);
continue;
}
if ( list.contentURL.includes(line) === false ) { continue; }
const groupkey = list.group2 || list.group;
const listEntry = qs$(`[data-key="${groupkey}"] [data-key="${listkey}"]`);
if ( listEntry === null ) { break; }
toggleFilterList(listEntry, true);
after.pop();
break;
}
}
Expand Down

0 comments on commit c223a8c

Please sign in to comment.