Adjusting search filter regex

Resolves issue with filtering results in HTML DuckDuckGo
pull/227/head
Kevin Payravi 2023-07-26 12:53:16 -05:00
parent d29ba617af
commit c09b8958a2
1 changed files with 3 additions and 1 deletions

View File

@ -67,7 +67,9 @@ function filterSearchResults(searchResults, searchEngine, storage) {
console.log('Indie Wiki Buddy failed to properly parse search results with error: ' + e);
}
// Check if site is in our list of wikis:
let matchingSites = sites.filter(el => String(searchResultLink).replace(/(.*)https?:\/\//, '').startsWith(el.origin_base_url));
let matchingSites = sites.filter(el =>
String(searchResultLink).replace(/(.*)https?(:\/\/|%3A%2F%2F)/, '').startsWith(el.origin_base_url)
);
if (matchingSites.length > 0) {
// Select match with longest base URL
let closestMatch = "";