This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.
Window.sizeToContent() method sizes the window according to its content. In order for it to work, the DOM content should be loaded when this function is called, for example once the
DOMContentLoaded event has been thrown.
The minimal size of the window can be clamped.
This feature is not part of any specification.
|Feature||Chrome||Firefox (Gecko)||Internet Explorer||Opera||Safari|
|Basic support||?||(Yes) ||?||?||?|
|Feature||Android||Firefox Mobile (Gecko)||IE Mobile||Opera Mobile||Safari Mobile|
 From Firefox 20, the mimimal size is clamped, to prevent the window to be too small for the user to interact with.
 On Firefox for Android, this method has no effect as a page is always in a tab.
© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.