title: "Inject" JavaScript in existing application to manipulate the UI (qwebirc)
body: <p>I need to inject some JavaScript into an existing application.</p>
  
  <p>The application is normally embedded with an <code>iframe</code> like this:</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
      &lt;iframe src="http://webchat.quakenet.org/" width="647" height="400"&gt;&lt;/iframe&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>It is an opensource JavaScript based IRC Client <a href="http://webchat.quakenet.org/" rel="nofollow">http://webchat.quakenet.org/</a> (<a href="http://hg.qwebirc.org/qwebirc/src/2e37e36ead85f1e36f85f689d5c66dcc8c0b90a3/js?at=default" rel="nofollow">source</a>).</p>
  
  <p>Now I like to inject some JS to Highlight special messages for example. For this I already found the <a href="http://hg.qwebirc.org/qwebirc/src/2e37e36ead85f1e36f85f689d5c66dcc8c0b90a3/js/ui/notifications.js?at=default" rel="nofollow">HilighterClass</a> to override.</p>
  
  <p>The problem is, how could I do that? I guess injecting JS into an <code>iFrame</code> is not "allowed" by modern browsers, or?</p>
  
  <p>If the <code>iFrame</code> is a problem, maybe I can add the client like they do:</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
  &lt;head&gt;
    &lt;base /&gt;
    &lt;title&gt;QuakeNet Web IRC (qwebirc)&lt;/title&gt;
   ...
    &lt;script type="text/javascript"&gt;
      var ui = new qwebirc.ui.Interface("ircui", qwebirc.ui.QUI, {"appTitle":"QuakeNet Web     IRC","dynamicBaseURL":"/dynamic/leibniz/","baseURL":"http://webchat.quakenet.org/","validateNickname":false,"networkServices":["Q!TheQBot@CServe.quakenet.org"],"nickValidation":    {"maxLen":15,"validSubChars":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_[]{}`^\\|0123456789-","validFirstChar":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_[]{}`^\\|","minLen":2},"staticBaseURL":"/static/leibniz/","loginRegex":"^You are now logged in as [^ ]+\\.$","networkName":"QuakeNet"});
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id="ircui"&gt;
      &lt;noscript&gt;
        &lt;div id="noscript"&gt;Javascript is required to use IRC.&lt;/div&gt;
      &lt;/noscript&gt;
    &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Requirements:</p>
  
  <ul>
  <li>The client should connect into the quakenet.org Servers. That could be a problem because of some Cross-Site-Scripting restrictions.</li>
  <li>The best would be if no other plugin's for my users are required.</li>
  </ul>