简体   繁体   English

最大化浏览器窗口和高度

[英]Maximise browser window and height

Is there a way in [pure] JavaScript to maximise a browser window and increase its height such that it doesn't have scroll bars? [纯] JavaScript中有没有办法最大化浏览器窗口并增加其高度,使其没有滚动条? Even if the height becomes greater than the screen. 即使高度变得大于屏幕。

Thanks all 谢谢大家

Update 更新资料

The reason I want to do this is so that I can capture the full page of the site as an image using selenium. 我这样做的原因是,我可以使用硒将网站的整个页面捕获为图像。 The native selenium functions do not work on all browsers and do not do exactly what I want so I've built my own image capture in C sharp but I need some JS code to increase height of browser. 原生硒功能无法在所有浏览器上正常运行,并且不能完全满足我的要求,因此我用C Sharp构建了自己的图像捕获,但是我需要一些JS代码来增加浏览器的高度。

目前还没有很好的解决方案,但是却离您很近: 如何使用Javascript将窗口全屏显示(在整个屏幕上拉伸)

The html element has the overflow property added to it with a value of hidden . html元素具有添加到其中的overflow属性,其值为hidden

Check this to hide the browser scrollbar 选中此选项可隐藏浏览器滚动条

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM