我们正在使用 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>