title: Google Chrome DevTools Extension - Detect Page Change
body: <p>I am trying to detect when the webpage has changed from a Google Chrome DevTools Extension.</p>
  
  <p>I currently have a <strong>devtools.html</strong> &amp; <strong>devtools.js</strong> that detects if a condition is true and if it is, it adds the dev tool panel.</p>
  
  <pre><code>chrome.devtools.inspectedWindow.eval(/*my test*/, function (result, exception) {
      if ( exception === undefined &amp;&amp; result === true ) {
          chrome.devtools.panels.create("My Panel", "", "panel.html", function (panel) {
              ...
  </code></pre>
  
  <p>The problem is, if I open up the dev tool, and <strong>then</strong> navigate to another page, it doesn't re-evaluate the condition and add the panel. I have to close and reopen the devtool again.</p>
  
  <p>I <strong>think</strong> I <strong>could</strong> do this with a background page that I pass the <strong>tabId</strong> too, but not looked into <strong>how</strong> to do this yet, but I don't want to go down that route if there is a very simple technique I have overlooked.</p>
  
  <p>Also, I have yet to find any information on <strong>Removing</strong> my panel once it has been created if the conditions were previously met, but no longer after a page navigation.</p>