title: How to embed Firebug Lite in my QWebView widget?
body: <p>I've started to embed some QWebView widgets to my desktop application (PyQt).<br>
  I use JQuery and CSS to enhance appearance and usability.<br>
  It would be comfortable to debug my html code with a web inspector.<br>
  How can I embed Firebug Lite in my QWebView widgets?</p>
  
  <p>E.g. I tried the following code and it doesn't work:</p>
  
  <pre><code>html1 = """
  &lt;html debug="true"&gt;
  &lt;head&gt;
      &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="https://getfirebug.com/firebug-lite.js#startOpened=true"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
      $(document).ready(function() { 
          $("body").css("background", "#f00");
          console.log("in here");
      });
      &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;&lt;h1&gt;Hello!&lt;/h1&gt;&lt;/body&gt;
  &lt;/html&gt;
  """
  html2 = """
  &lt;html debug="true"&gt;
  &lt;head&gt;
      &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
      $(document).ready(function() { 
          $("body").css("background", "#f00");
          var firebugLite = document.createElement("script");
          firebugLite.src = "https://getfirebug.com/firebug-lite.js";
          firebugLite.id = "firebug_lite";
          firebugLite.textContent = "{ startOpened: true }";
          document.getElementsByTagName("head")[0].appendChild(firebugLite);
          console.log("in here");
      });
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;&lt;h1&gt;Hello!&lt;/h1&gt;&lt;/body&gt;
  &lt;/html&gt;
  """    
  
  if __name__ == '__main__':
      app = QApplication(sys.argv)
      view = QWebView()
      frame = view.page().mainFrame()
      frame.setHtml(html2)
      view.show()
      app.exec_()
  </code></pre>
  
  <p>html1 and html2 have the same effect: body turns into red but Firebug doesn't show up. </p>
  
  <p>P.S. my actual html code can't be debug with an external client browser,<br>
  because it uses QT resources and application window objects.</p>