【发布时间】:2018-03-19 06:37:40
【问题描述】:
我们正在使用 window.Open 打开一个浏览器窗口,并设置桌面的可用宽度和可用高度。 它在除 Windows10 之外的所有 Windows 操作系统上都能完美运行。 IE、Chrome 和 Firefox 在浏览器窗口的右侧和左侧获得了一些空间。我花了很多时间找不到合适的解决方案。有什么办法可以解决这个问题吗?
谢谢,
<script>
var useragent = navigator.userAgent;
var tabScreenWidth = screen.availWidth;
var qsScreenWidth = "&screenWidth=" + tabScreenWidth;
var str = GetQueryString();
var MainWindow = window.open('Authentication/PSGLogin.aspx?' + str + qsScreenWidth, '', 'top=0,left=0,resizable=NO,toolbar=no,status=no,directories=no,menubar=no,scrollbars=0', false);
MainWindow.moveTo(0, 0);
var WindowWidth = screen.availWidth;
var WindowHeight = screen.availHeight;
if (WindowWidth > 1024)
WindowWidth -= 1;
MainWindow.resizeTo(WindowWidth, WindowHeight);
window.opener = self;
window.open('', '_self');
setTimeout("retryCloseWindow()", 2000);
function retryCloseWindow() {
window.opener = self;
window.open('', '_self');
//window.close();
setTimeout("retryCloseWindow()", 2000);
}
function GetQueryString() {
var qString = location.href;
var aryString = qString.split('?');
return aryString[1];
}
</script>
【问题讨论】:
-
我怀疑这是因为 Windows 10 将窗口周围的边框缩小到了 1px。这些浏览器可能尚未更新其对窗口大小的计算以考虑较窄的边框。有趣的是,我可以在 Chrome、IE 和 Firefox 上重现这一点,但不能在 Edge 上重现。
标签: javascript jquery windows-10-desktop maximize-window