0

I wanted to check article on one news website, which had pretty annoying popup forcing me to disable addblock, so I quickly wrote a browser extension to remove it.

This made me thinking - I need to ensure news website loaded, cuz im manipulating with its DOM, which I carelessly acchieved by setting timeout.

Maybe theres any better way?

Drahoš Maďar
  • 479
  • 2
  • 6
  • 22
  • 1
    When you are waiting for a specific element, you can do [this](https://stackoverflow.com/a/61511955/4054683). You can also use window events, and such as [load](https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event) and [DOMContentLoaded](https://developer.mozilla.org/en-US/docs/Web/API/Document/DOMContentLoaded_event) – Neea Nov 05 '21 at 23:50

0 Answers0