<p>I am creating a Firefox Extension...what would be the javascript to open a URL in the current tab from a menuitem?</p>

<p>e.g. in my overlay.xul file i have the following line:</p>

<pre><code>&lt;menuitem label="Visit homepage" oncommand="window.location='http://www.somepage.com'"/&gt;
</code></pre>

<p>but in firefox, when i click on the menu item, it opens the URL but it screws up the entire layout of the browser.</p>

<p>What's the correct way to do this?</p>

After browsing around, I found that I had to replace the above code with this:
```
```
<menuitem label="Visit homepage" oncommand="content.wrappedJSObject.location='http://www.somepage.com'"/>
```
```