bogen
bogen

Reputation: 10432

How to run script when page loads content dynamically for Chrome Extension

I have a script than runs at page finished loading to insert some stuff to the DOM. How to listen for when page is loading more content dynamically? One example of this dynamic loading is when you scroll down your feed on facebook, and more content is added to the list as you scroll down.

Upvotes: 0

Views: 302

Answers (1)

Inferpse
Inferpse

Reputation: 4145

You can use MutationObserver to do this. Check documentation here.

Example of usage and fiddle available in this SO question.

Upvotes: 1

Related Questions