Chrome Extension: How to run Javascript on page load (without popup open) -


i have chrome extension word substitutions on pages. have popup opens when click on browser action lets user control whether or not perform substitutions. have background script running sends message content scripts when page refresh happens using chrome.tabs.onupdated event handler.

my problem when refresh page no substitutions made unless popup open (which possible when have inspect elements panel open on popup, because otherwise popup closes when refresh).

has had experience behavior before? additional instrumentation should add diagnose problem? there different extension architecture/code arrangement should using?

thanks in advance!

if use localstorage on given page can store whether or not substitute words. think refreshing page similar opening new tab, script gets reinjected/reloaded rather staying open , receiving onupdate message.


Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -