改变浏览器中的XULRunner内容 [英] changing the content of browser in XULRunner

查看:317
本文介绍了改变浏览器中的XULRunner内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个加载全屏没有任何控制,并且默认加载HTML页面的应用程序的XULrunner。它拥有的唯一的事情就是浏览器元素和弹出的菜单中点击右键可见。
在弹出的菜单中有选择退出。然后有一个菜单项THEME2。我希望浏览器被点击时THEME2加载另一个HTML。

I have an Xulrunner app that loads fullscreen without any controls and loads a html page by default. The only thing it has is browser element and a popup menu visible on right click. In the popup menu there is option to quit. Then there is a menu entry 'theme2'. I want the browser to load another html when theme2 is clicked.

这是我的main.xul,这就是默认加载的:

This is my main.xul, thats loaded by default:

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="main" title="Edusoft" hidechrome="true" sizemode="maximized" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript">
function do()
{
 var browser1 = document.getElementById('browser');
 browser1.loadURI("chrome://myapp/content/theme2/home.html");
}
</script>

<browser id="browser" type="content" src="chrome://myapp/content/theme1/index.html" flex="1" context="clipmenu"/>



<popupset>
  <menupopup id="clipmenu">
       <menuitem label="About Us"/>
    <menuseparator/>
    <menuitem label="Theme2" oncommand="do();"/>
    <menuseparator/>
    <menuitem label="Exit" oncommand="close();"/>
  </menupopup>
</popupset>

</window>

我想这一点,但是当页面加载这种方式..弹出菜单是曲子的新的一页。

I tried this, but when the page is loaded this way.. the popup menu is nomore in the new page.

window.location.assign()

有是像 loaduri(),但我对如何使用它不知道。

There is something like loaduri(), but i have no idea on how to use it.

推荐答案

好吧,我想通了。

document.getElementById('browser').loadURI('chrome://myapp/content/flash/demo.htm')

这篇关于改变浏览器中的XULRunner内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆