keep windows always on top

Subscribe to keep windows always on top 7 posts, 4 voices

 
lazyttrick Scriptwright

hi, I'm trying to keep a popup window always on top... i'm calling in the popup a self.focus on blur... it works the first time only...

document.write(1);
self.focus();

the first time it writes and regain focus, but the other times it justs writes 1 and the window stay behind...
i'd like to stay always on top... any idea?

 
Mikado Scriptwright

What about using modal dialog instead of normal popup window? Refer to DOM:window.openDialog.

 
LouCypher Scriptwright

You mean DOM:window.open.
DOM:window.openDialog is chrome privilege.

 
lazyttrick Scriptwright

i just need the popup visible, so user can interact with parent while seeing the popup... it seems the easy way would be to use alwaysRaised=yes, but it requires privilege...
so, is there a hard way?

 
Descriptor Scriptwright

Maybe he's thinking of showModalDialog() which is another silly IE method being introduced in FF3 (I guess), it doesn't work in SeaMonkey (yet).
but...
dependent=yes

may still work, at least that's always been the way in the past, and I don't understand why they are removing it.
What we really need for Greasemonkey is GM_openDialog(). In fact, I was looking at the GM code and I don't see that it's all that hard to add some methods like this.

But to fix your problem, I think you need to make a reference to the window object like var newWin = window.open(etc), then you can use newWin.focus(), but I haven't messed with this for quite some time.

 
Mikado Scriptwright

You could avoid using windows at all, just make a DIV (or IFRAME) with fixed position and high z-index.

 
lazyttrick Scriptwright

That was my plan B... but I prefer it floating above all tabs

funny is focus() works exactly 1 time... I wonder if this is some FF protection... it doesn't seem to allow this behavior