I have not ever used XUL and it seems quite mysterious. What does it take to create a simple XUL application that simply loads a webpage on a Linux environment?. No need for window decorations, history, back or forward buttons. Just the simplest possible XUL app that loads a web page... Using xulrunner with GRE version 10.0.11.
Also, where is the best place to get tutorials to learn about writing XUL application?
I found the answer. Here is one one way to do it.
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="main" title="Konami Browser" width="800" height="600"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<browser type="content" src="http://google.com/" flex="1"/>
</window>
Of course the other files in the directory structure are required as well.
Maybe this will do the trick, loading the page from the commandline argument:
Start with:
xulrunner /path/to/application.ini -test "http://www.google.nl"
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<script type="application/x-javascript"> <![CDATA[
function init_browser()
{
var cmdLine = window.arguments[0];
cmdLine = cmdLine.QueryInterface(Components.interfaces.nsICommandLine);
document.getElementById('id_browser').src = cmdLine.handleFlagWithParam("test", false));
}
]]></script>
<window id="main" title="Konami Browser" width="800" height="600"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="init_browser();">
<browser id='id_browser' type="content" src="http://google.com/" flex="1"/>
</window>
]]></script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With