Xul's window.blur() doesn't work? Is there an alternative? -


i'm trying use window.blur() open window without focus (or focus , unfocus fast, looks not focused).

but looks doesn't work, there alternative?

my attempt:

blurtest.xul:

<?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>  <window width="400" height="300"     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">      <script>         <![cdata[             function onkeypress(event) {                 // sample don't matter key pressed                 open('second.xul','secondwindow','chrome, width=400, height=300');             }             addeventlistener("keypress", onkeypress, false);         ]]>     </script>      <label value="main window"/>  </window> 

second.xul:

<?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>  <window width="400" height="300"     onload="blur();"     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">      <label value="second" />  </window> 

obs. can think use settimeout(window.focus, 1) call focus window after open second window. need second window handle focus. perfect scenario if second window never able focus, open/restore window without focus.

you can open xul window if popup using popup window feature in opendialog call. should open topmost window doesn't steal focus. note default popup window has no os chrome; on windows can add titlebar feature (which gives mini title bar palette window) , close button (in conjunction title bar), don't know feature flags work on other platforms.

desktop alerts still use feature on windows believe on linux use libnotify , on mac use growl.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -