I can't describe with expert knowledge but let me tell you my opinion.
I think the best option is using the scroll event and check window height every time the site is scrolled
setInterval is not a good option I think because if you set delay with long term, it would be shown has late response time or if you set delay with short term, the function is called lots of times even not necessary
And I'm not familiar with Mutation observer and Intersection observer but I know that both of these need to point to an element that is observed. It's okay if you know which element you have to watch but you are a third party. you have to check every time when the site is updated.
but Scroll event is doesn't have to point to an element and it will be called to a minimum.
I think the best option is using the scroll event and check window height every time the site is scrolled
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…