Does JavaScript window.resizeto have maximum values? - javascript

I am resizing a popup window when an anchor is pressed.
It works well on my desktop computer, but it doesn't on my laptop.
It resizes to a value smaller than the specified in window.resizeto().
Does JavaScript window.resizeto have maximum values in browser settings? How do I change those values?
Thanks

This will depend only on the browser, and OS limitation.
For example, according to Mozilla Dev Network Documentation :
Specification
DOM Level 0. Not part of any standard.
So this only depends of the browser implementation of window object.
Check the resizeTo method Browser Documentation to see the size limitations.
IE and FF do not seem to make a limitation in the window size,
it will depend on how the OS GUI will handle the new size.
However, MDN says this about resizeTo rules :
You can't resize a window or tab that wasn’t created by window.open.
You can't resize a window or tab when it’s in a window with more than
one tab.
https://developer.mozilla.org/en-US/docs/Web/API/Window.resizeTo
MDN Documentation should be the most standard documentation. (Even if, as they described, this method is not standard)

My desktop has 2 screens and the maximum width available is the sum of both.
Thank you all for your help.

Related

Take mobile screenshots with Chrome extension

I'm building a Chrome extension that takes a screenshot of the user's active tab. I want to take both desktop and mobile screenshots.
For Desktop screenshot, I use the the chrome.tabCapture API functions and capture the content of the currently active tab.
How can I take a screenshot for mobile or custom dimensions?
You can use chrome.windows.update to force a resize. The received updateInfo object should have the width and height you wish to use. (there is no standard 'mobile' size).
You'd probably want to also -
Store the pre-resize dimensions and restore to it later. You can do it with chrome.windows.getCurrent, and inspect the returned Window for width and height.
Take care to account for toolbars and window margins, to get as
close as you can to emulating true mobile experience.

screen.width produce different result on Firefox and Chrome

I was working a with a site and I had know the width of the screen that's why I tried with screen.width but I don't know why I'm getting different result on Firefox and Chrome. Seems Firefox showing me the correct value but Chrome doesn't.
Is there is anyone who can assist me to know whats the reason?
Thanks
The reason is that there is no current standard that defines what the value should be. The closest is the CSSOM View Module, which states that:
The width attribute must return the width of the output device, in CSS pixels.
However, that specification is a Working Draft, which means it is a work in progress and the definition stated may not be what is implemented. Indeed, the Editor's Draft gives two different definitions:
The Web-exposed screen area is one of the following:
The area of the output device, in CSS pixels.
The area of the viewport, in CSS pixels.
So obviously, browser vendors are taking whichever definition they want.
For more discussion on that property, see PPK's rant "screen.width is useless" on Quirks Mode

Can any browser open a new window larger then the screen size?

One of windows in my application has the size set by administrator. I need to be sure that the window does not open with any border out of screen. By my experiments the window fills the screen when the required size in window.open (resizeTo) is larger. However, is it true for any resolution and any browser (operating system)?
Edit
May I hope that the size cannot be larger when outerWidth (outerHeight) is not supported? ( Getting the width/height of the entire browser in IE? )
Edit 2
I have made tests on Fedora 16 (LXDE, Plasma, Gnome) with Konqueror and Firefox. I did not succeed to open a window larger then screen.
#vanH: then you need to provide height and width parameter
window.open("", "mywindow1", "status=1,width=2050,height=2150");
I did not manage to find a way how to do it and it seems that there is no useful proposal (for about a month). So I conclude it is not possible (or not simply possible on major operating system/browsers).

jQuery resize and position current browser window

How can I set height, width and set the position of the current browser window in the document.ready() function of jQuery ?
There supposed to be two javascript functions to resize and move the browser window:
window.resizeTo(width, height);
window.moveTo(x, y);
These functions are not supported by Chrome and Opera, and other browsers might experience certain security restrictions as well.
If you want to pop a new window with a certain size, check out the parameters of window.open(). Your interface should also not rely on it entirely, for example you won't be able to do it on mobile browsers.
When thinking about if something is possible or not it's always a good start to think about ways to abuse it. Would you want windows on your screen to jump around every 100 milliseconds, just because some website wants to do that? Probably that's why it's unsupported or limited these days.

How do I find out the size of a browser application window including the border, header and footer?

I am looking to create a fullsize window using javascript but I am having difficulties trying to take the actual size of the window into account. I can get the resolution of the desktop but if I set the windows width and height to that value, it is not 100% correct as it does not seem to be taking into account the size of the border for the browser application itself. How can I calculate my target width and height to take the browsers application border into account?
So basically you want to mimic the effect of hitting F11? Check out [old dead link]
I want to warn you that it's a usability nightmare. Try to think of a better way to execute your design without going full screen. Messing with the user's system settings is a HUGE no-no, and changing browser dimensions/resizing windows definitely falls under that category.
To find out the windows height and width you can use the following:
window.innerHeight/Width -> All browsers but not IE
document.body.clientHeight/Width -> All browsers
document.documentElement.clientHeight/Width -> All browsers
More info here: http://www.howtocreate.co.uk/tutorials/javascript/browserwindow

Categories

Resources