<p>I am writing a web application that will run in kiosk mode on a touch screen. I am currently only targeting it for running on Firefox 3. A few of the use cases I have need to visit external sites. I wish to do so with an embedded browser, which I'm tackling with the help of an <code>&lt;iframe&gt;</code>. I need back/forward buttons for the embedded home page. </p>

<p>I've managed to access the history object of the iframe with</p>

<pre><code>var w = document.getElementById('embeddedBrowser').contentWindow;
w.history.back();
</code></pre>

<p>The <code>history</code> of the embedded window is the same as that of the parent window. Therefore for a newly loaded <code>&lt;iframe&gt;</code>, this call will go back to the previous page of the system.</p>

<p>Is there any way to avoid this or a more correct way of solving this?</p>

You might want to take a look at
Adobe AIR
. It lets you write your application using all the same tools / languages (ajax, html, etc etc), but since it runs as a desktop app and not in a web browser, you have more control over things, such as embedding browser frames and knowing exactly what they are doing, what URL it's going to, controlling it's history, etc.
Look here
for a few pointers on getting started.