Popup window always on top - javascript

Am looking at whatever hacks that are possible to keep a window always on top (apart from window.focus()). Maybe a hidden textbox to which I can set focus etc.
I see this happening in LivePerson (support) whenever a new message arrives. I have legitimate use of this and not to annoy users with ads or anything.
Any hacks for any browsers will do. I am not looking at a complete cross-browser solution. I think window.focus would work for Internet Explorer, though I am yet to test it.

This JavaScript code will place the popup window on top of all other open browser windows until the viewer closes the window containing this little JavaScript code:
<body onblur="self.focus();">

Related

Is it possible to remove all chrome from a browser window (not full screen)

Is it possible to remove all "chrome" from a browser window, without going full-screen (with or without CSS/js) Ala Quicktime modal?
So all you see is the content and the drop shadows no toolbars, not even the close/minimise/minimise toolbar.
No, it isn't.
You can open a new window with some chrome removed using the strWindowFeatures features of open, but you've never been able to remove the title bar and more features set to Always On by browsers as an anti-phishing measure.
You could get something similar to what you are asking for by just using an iframe in an existing page. Obviously, it won't be free floating.

Make a popup (not modal) browser window stay visible even when not active

Is there anyway to make a popup window (not a modal) stay visible, even when it is inactive. I know this sounds like a ridiculous question, and I'm expecting that this can't be done.
But if it can be, any direction will be much appreciated. I found the "dependent" property, which is not supposed to work on OSX - which I am using.
http://www.gtalbot.org/BugzillaSection/Bug195867GDR_WindowOpen.html#GrpFunctionalityFeatures
I don't need this to be cross browser/OS compatible, if it works on a single platform/browser then that's ok.
I'm not sure if "dependent" will do the trick or there's another/better way.
I don't think you can control "always on top" behaviour of the browser window using JavaScript from the browser. However, if the popup is always on top, then it must be blocking a part of your browser window. So, instead of a new browser window, make it a <div> block with position: fixed; and place it where you want on the page. This you can control with JavaScript.

browser window to stay on top like the "showModelessDialog" method

I would like to have a browser window stay on top of other windows similar to the "showModeLessDialog()" method. What I dont like about the "showModeLessDialog()" method is that once the user moves to another page the modeless dialog box disappears.
To get around the closing of the browser window by just opening the browser window through window.open() but the one feature im lacking that I really want is the stay on top featured.
Any ideas on how to accomplish that? The showModeLessDialog is doing it...
Also, Im well aware of various opinions on the subject of forcing windows to stay on top so no need to remind me. I have a good reason for this I assure you. :-)
Are you using javascript for popup window,
http://javascript-array.com/scripts/window_open/
you can set these parameters top=20,left=20

Open Popup when user leaves the site (but not when user clicks on an internal link )

Here is what I need to do:
I want to launch a popup window when the user exits the website.
I found code that detects when the user closes the window, but that same code ALSO fires when the user clicks on an internal link,
(which I don't want).
Any ideas how to do this?
I've looked everywhere and I can't find a clear solution.
This solution needs to work on all three browsers : FireFox / IE / Safari!
You can't, there is no such event that will be triggered when someone exits the site. That's why in the early 2000s someone too clever invented "pop-unders": popups that will open immediately, but will be put on the background, behind the browser's window.
Which are one of the most annoying things on the web, and the first ones that any popup blocker or antivirus will kill :) On the other side, there are legitimate uses for that, like most surveys you see (I got one from microsoft some days ago).
Never rely on popups, unless you are writing an intranet site, or one where you are sure all of your visitors will not have a popup blocker.

Maximizing the current window in javascript

Is there a way I can maximize a currently minimized window from Javascript? Here's my situation:
I have a series of links that all target the same external window (e.g. "MyNewWindow"). When I click a link, a new window pops up. If I click another link, the page pops up in the same window as expected. If I minimize the "MyNewWindow" popup, I'd like to be able to click another link and have that window maximize.
My approach was to put something on the onLoad part of the body so that when the page is refreshed it will automatically "maximize" if it is minimized. Note: Using window.MoveTo() and window.resizeTo() doesnt seem to do the trick (the window stays minimized).
Thanks!
For all of you know-it-alls, there are perfectly good reasons to want to know how to do this. Here's the reason I needed this:
I'm deploying SCORM modules to a variety of Learning Management Systems (LMSs)
One LMS that a client is using launches the module in a small (600x400) window, with the user controls to maximize or resize said window DISABLED
The client doesn't know how to change this launch behavior
My only option is to try to maximize via javascript, because the idiots who made the LMS took away the user's ability to manage their own windows.
window.moveTo(0, 0);
window.resizeTo(screen.availWidth, screen.availHeight);
This may not work in IE depending on the security zone your page is falling under, and it may not work in Chrome at all. But for a corporate environment in an intranet, it has a good chance of working.
Don't do this, you are not allowed to do this by most modern browsers for a reason.
In a tabbed environment you're not messing with only the window you may have created, but all of my tabs, that's unacceptable. It's the user's computer, user's browser, it's the user who chose to go to your site...let them size the window the way they want it, doing anything else breaks their experience...and their trust in your site.
The behavior you're looking to emulate is what your run-of-the-mill malware does...re-think your approach, please. For example focusing that window is appropriate for what you want, let the default behavior of the browser take over from there, like this:
var thatWindow = window.open(url, "linkWindow");
thatWindow.focus();
try to use window.open(url,fullscreen=yes);
if you out fullscreen=yes than while clinking on link automatically

Categories