I'm trying to figure out how I could use window.open to open a window in Chrome without having this window displayed on top of the active window.
I'm using this:
_Top.window.open(myURL,myWindowID,'toolbar=0,scrollbars=1,location=1,statusbar=1,menubar=0,alwaysLowered=yes,z-lock="yes",resizable=1,top=800,left='+pxLeft+',width='+myWidth+',height='+myHeight);
I'm trying with alwaysLowered, z-lock, ... but when used on Chrome, the new windows comes on top of the active window. It works in Firefox and IE but not on Chrome.
I also use:
_Top.window.blur();
Is there a parameter to achieve this or should I use something else for Chrome?
Thanks
Laurent
Related
I m working on a chrome extension where I need to show a window like this one, which remains always on top of other windows. Is there any chrome helper method for creating this?
I have a script that opens a chrome window like so chrome.exe --user-data-dir="%LOCALAPPDATA%\Google\Chrome\User Data\" --window-size=1280,118 --window-position=0,0 --app="file:///C:/desktop/test.html" I need to open another smaller popup window from that window but the popup always opens in the same size as its parent (1280x118). I have tested using window.open('','','resizeable, width=100,height=200') from a regular chrome window and it works as expected. It seems that window.open does not respect the width and height specified if it is launched from a window with a specified window-size. Are there any alternatives to window.open? Or does anybody know how to make this work in Chrome? Its working fine in IE but want to phase out IE for obvious reasons.
I made this work by setting window.open to a variable and then using window.resizeTo to change its size.
var myWindow=window.open('','newWin','width=200,height=100');
myWindow.resizeTo(200,300);
myWindow.moveTo(500, 100);
myWindow.focus(); ```
I have a working implementation of full screen working for Safari, Firefox, and Google Chrome. From what I have read it should work for ie with google chrome frame but when I click the full screen button I created nothing happens. Any ideas? Is it not yet supported?
$('#enable_fullscreen').click ->
calculate_presentation_font_size(height)
if docElm.requestFullscreen
docElm.requestFullscreen()
else if docElm.mozRequestFullScreen
docElm.mozRequestFullScreen()
else if docElm.webkitRequestFullScreen
docElm.webkitRequestFullScreen()
Putting an alert in the "webkitRequestFullScreen" if statement shows that it does go to this condition in chrome frame but docElem.webkitrequestFullScreen() is undefined.
I've build it and made it work from this examples.
https://developer.mozilla.org/en-US/docs/DOM/Using_full-screen_mode
The only things I can see missing from your code for the webkit condition is the parameter "Element.ALLOW_KEYBOARD_INPUT" to the webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)
Unfortunately the main problem of chrome frame is the communication with the IE window that literally behave like a difficult child ;-)
For IE you can open a popup window in fullscreen mode by directly calling document.location.href for the source it will open the current page your are on
window.open(document.location.href, 'myAppfullscreen', 'fullscreen=1');
I have a JavaScript to re-size all my popup windows:
function resize()
{
window.resizeTo(240,230);
}
But now it is not resizing in Mozilla Firefox, but it was doing earlier, also
or if the popup window is opened in a new tab, it is not resizing, also in some browsers it is not also. Is there any piece of JavaScript code which works in all scenarios and all browsers?
Firefox comes with a preference for user to allow/disallow resizing of
window using Javascript. It's in Tools - Options - Content - Enable
Javascript -> [Advanced].
I am not sure if resizing is disabled by default, but you might want
to check your own Firefox installation first.
If it's disabled by default, then unfortunately there is nothing you
could do to resize the window after it has been opened. An ugly
workaround would be to open itself once again using window.open() with
the preferred size though.
Source: timdream (here)
I'll also add that:
You can't be assured that any browser will let you control the size of
windows you create. You can't even be sure you'll get a window at all
- people can instruct their browsers to open all new windows as browser tabs
Source: Pointy (same source as timdream)
On iPad Safari, there seems to be issue with popup. When a popup (opened using window.open()) is closed, it remains in minimized mode (or grid view) after closing the popup...It
does not return focus to the parent window.
I have tried using parent.opener.focus(), but still does not work.
Is this a known iPad issue OR can we fix this issue using some JS code?
Please help.
I'm not sure if this would help, but just some personal experience on this issue:
Did you try going to iPad's Setting - Safari - Block Pop-ups? Try turning off Block Pop-ups, it should work.
If it still doesn't appear, try turning on the Debug Console for the ipad and check if any error appears during the popup event.
Try using a URL for window.open to be a local / same domain url address. I think that works (without needing to turn off the popup blocker in safari ipad).