Reputation: 28345
By running this sample:
<?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>
..you can see that the window
's focus event will be thrown only if the focus is not on the browser
. I added a button in the bottom, so you can remove the focus from the browser and see what I mean:
button
is focused and you minimize and restore the window, you'll see the focus event occur.browser
is focused and you minimize and restore the window, the focus event will not occur.I need this focus event to happen when the browser
has the focus, any idea how to accomplish this goal?
Upvotes: 0
Views: 1240