This question does not really fit that well within Stack Overflow, IMHO, because it is not about code, but about programming principles in general.
Thus, no-one can give you an answer showing how your code should look like. But at least we can come up with advises on how to deal with your scenario.
My advise would be for you to:
- Debug the network traffic for each and every social media site your are supporting. Look for XHR requests at the network inspector, and inspect the responses to find which endpoint is responsible for fetching more content.
- In the Sources tab of the web inspector, Add a new XHR/fetch breakpoint for this URL
- Inspect the stack trace backwards, until you find a function or method call which is responsible for calling the content fetch
- Verify that when you call this function, content will load via XHR and will be injected in your network feed. If not, you may have to drill further down the rabbit hole, or continue single-stepping the execution to find which method/function is responsible for injection the newly loaded content into the document.
- When you have successfully managed to reliably reproduce this, your extension have to inject code into the page itself in order to trigger the content loading