title: Chrome Extension: How to run Javascript on page load (without popup open)
body: <p>I have a Chrome extension that does word substitutions on pages. Currently I have a popup that opens when I click on a browser action which lets the user control whether or not to perform the substitutions. I also have a background script running that sends a message to content scripts when a page refresh happens using a chrome.tabs.onUpdated event handler.</p>
  
  <p>My problem is that when I refresh the page no substitutions are made unless the popup is open (which is only possible when I have the inspect elements panel open on the popup, because otherwise the popup closes when I refresh).</p>
  
  <p>Has anybody had experience with this behavior before? What additional instrumentation should I add to diagnose the problem? Is there a different extension architecture/code arrangement I should be using?</p>
  
  <p>Thanks in advance!</p>