Block unwanted sites from your Google, DuckDuckGo, Startpage.com, Bing and Yahoo search results. v2.3.5 2025-03-21
< 腳本Google Hit Hider by Domain (Search Filter / Block Sites)的回應
I have fixed the issue on my system by doing this:
encapsulate the whole code inside
var inited;
function init() {
if (inited++) return;
[... your code here ...]
}
if (document.readyState != 'loading') init();
else {
document.addEventListener('DOMContentLoaded', init);
window.addEventListener('load', init);
}
And set the userscript to run at document-start
I wasn't able to replicate the problem on Firefox or Chrome.
Your solution implies that in some situations, the current script might be running too early, or is missing changes to the page after it runs (some kind of observer failure). I don't use DDG regularly, so hopefully we can get some more clues from other users about when the problem occurs.
It doesn't work properly on duckduckgo.
The "block" button only appears in one out of 5-10 pages (re)load. Also, hidden hosts are not hidden when the button doesn't appear.