From c3b76574339813a5b3d002ac5d13135be1408f28 Mon Sep 17 00:00:00 2001 From: tophf Date: Sat, 22 Feb 2020 15:37:22 +0300 Subject: [PATCH] fix category check when searching for `foo.bar.tld` (#863) --- popup/search-results.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/popup/search-results.js b/popup/search-results.js index 8c35487d..9e6cbab2 100755 --- a/popup/search-results.js +++ b/popup/search-results.js @@ -623,7 +623,7 @@ window.addEventListener('showStyles:done', function _() { fourth || third && third !== 'www' && third !== 'm' ); - return (keepThird && `${third}.` || '') + main + (keepTld ? `.${tld}` : ''); + return (keepThird && `${third}.` || '') + main + (keepTld || keepThird ? `.${tld}` : ''); } } @@ -632,7 +632,7 @@ window.addEventListener('showStyles:done', function _() { result.subcategory && !processedResults.some(pr => pr.id === result.id) && (category !== STYLUS_CATEGORY || /\bStylus\b/i.test(result.name + result.description)) && - category.split('.')[0] === result.subcategory.split('.')[0] + category.split('.').includes(result.subcategory.split('.')[0]) ); }