
Untitled
By: a guest on
Jul 4th, 2012 | syntax:
None | size: 0.62 KB | hits: 10 | expires: Never
How to listen to focus event of a window with a browser?
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window width="640" height="480"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="">
<script>
<![CDATA[
function onfocus() {
dump("FOCUSED!n");
}
window.addEventListener("focus", onfocus, false);
]]>
</script>
<browser id="gmail" type="content" src="http://gmail.com/" flex="1" />
<button label="click here to remove the focus from the browser"/>
</window>