5 ms·
Firstly, thank you for building this I have exactly the same itch and I'm so glad someone provided a way to scratch it. > The plugin maintains a persistent and
by sequence7 6y ago
Firstly, thank you for building this I have exactly the same itch and I'm so glad someone provided a way to scratch it.
> The plugin maintains a persistent and customizable list of URLs (keywords) that are used as a 'blacklist' for stripping results.
Could you explain a little more about how the stripping of the 'blacklist' works.
- sequence7 6y agoOK, I suppose I could be slightly less lazy and read the source, which shows that you're iterating through the blacklist then iterating through the results page and removing elements that match. There are some default offenders blacklisted automatically by the look of it, nice and simple. var blacklist = new RegExp('https?:\/\/.*\.(geeksforgeeks|tutorialspoint).*\.*'); function clearURLs(urls) { var i, j, arr, res, url; arr = []; res = document.querySelectorAll('div.rc'); for (i = 0; i < res.length; i++) { for (j = 0; j < urls.blacklistURLs.length; j++) { if (res[i].firstChild.firstChild.getAttribute('href').indexOf(urls.blacklistURLs[j]) !== -1) { arr.push(i); } } } arr = [...new Set(arr)]; for (i = 0; i < arr.length; i++) { url = res[arr[i]].firstChild.firstChild.getAttribute('href'); url = 'Wiper blacklisted URL: <a href="' + url + '">' + url + '</a>'; res[arr[i]].parentElement.innerHTML = url; } } browser.storage.local.get('blacklistURLs').then(clearURLs);