This is entry of background.js from where an insertText() function is called.
$(document).ready(function() {
// Handler for .ready() called.
InsertText();
});
This function call only happens at the first load of the web site. Any subsequent load/change in the web page that I’m currently scrolling, this doesn’t get called. Where am I going wrong? Do I’ve to write a tab change listener for this?
You’re binding to the wrong event.
readyis triggered when the DOM is loaded, if you want to do something when the page is scrolled, then bind toscroll: