Some sites (like theVerge.com) load slowly with PiHole due to async-hide

Since I started using PiHole there are a few sites which load very slowly, theVerge.com being one of them. Each page is blank for about 4 seconds and then shows up.

After much digging I found that this is due to a "flicker reduction" technique. The page starts out hidden via the class async-hide being added to the html element. Normally this class is removed once the ads on the page load, but since no ads are loading it is not removed until a timeout triggers, 4 seconds after the initial page load.

I was able to fix this for Safari by using an extension named PageExtender. I created a short javascript snippet, placed it in PageExtender's folder, and then turn on PageExtender for theVerge (or any other site I want to fix this for).

Here's the code snippet:

var itemList = document.getElementsByClassName("async-hide");

for (let item of itemList) {
  item.classList.remove("async-hide");
}
2 Likes