Tuesday, May 08, 2007

test.xul file

And I use this as tests.xul file now, for easy file browsing:

<?xml version="1.0"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
width="600" height="600">
<script type="application/javascript"><![CDATA[
function doe2(e) {
var str = 'chrome://tests/content/'+e.target.href.replace('file:///C:/testfiles/','');
e.target.href = str;
window.location = str;
e.preventDefault();
}

function doe() {
document.getElementById('content').contentWindow.addEventListener('click', doe2, true);
}
]]></script>
<browser id="content" flex="1" src="file:///C:/testfiles/" type="content-primary" onload="doe()"/>
</window>

No comments: