title: How should Urls from User Options be matched in Content_Script?
body: <p>I am writing an extension that has options which let users decide which sites they want the extension to run on. </p>
  
  <p>Say the user has this site in the options</p>
  
  <pre><code>site                          action
  stackoverflow.com/*           change background css to blue
  google.com/*                  change background css to green
  </code></pre>
  
  <p>I store these string in the options. When the content_script runs should I retrieve these strings from options, loop through each one, parse with a urlParser into parts, turn each part into a regex (escaping everything but *), and compare it with document.URL? I recently read that this kind of user options validation for Urls should be done through a background script too so I'm not sure which way to go or if there's a more obvious way to do it.</p>
  
  <p>I think extensions like Adblocker and Vimium seem to have this functionality but for deciding which sites <strong>not</strong> to run on. I want to figure out how to decide which sites <strong>to</strong> run on.</p>
  
  <p><strong>Update to the Question:</strong> Since my content_script needs to run at document_start (before the page is loaded since it deals with editting the page appearance) as a content_script, will the background page be able to execute the content_script <strong>before</strong> the webpage is loaded at all?</p>