3

enter image description hereWe are opening a browser window using window.Open and sets the desktop's avail width and avail height. It's working perfectly on all Windows OS except Windows10. IE, Chrome and Firefox get some space on browser window's right and left. I spend many hours I am not able to find the right solution for this. Is there any solution to fix this issue?

Thanks,

<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>
Pandiyan
  • 129
  • 1
  • 1
  • 7
  • I suspect this is because Windows 10 shrunk the border around windows down to 1px. Those browsers may have not updated their calculation for the window size to account for the narrower borders. Interestingly, I can reproduce this on Chrome, IE, and Firefox but not Edge. – Josiah Keller Mar 20 '18 at 04:35

1 Answers1

0

By testing on my side, the browser window can open in full screen correctly. I tested with Chrome browser in windows 10 build 16299. If you mean there're some spaces inside the browser's left and right and the HTML page is in the center, in that case, this depends on the page you are opening, nothing relationship with window.open method. This is defined by the style defined in the page.

Try open window.open method page in the window, this page seems to be setting style to occupy the browser window. Or you may try to check what's the result if you open the Authentication/PSGLogin.aspx page in the browser directly.

Sunteen Wu
  • 10,509
  • 1
  • 10
  • 21
  • Hi Sunteen, Thanks for your reply. Here, we are using windows 10 build 15063.0. And the spaces are not inside browser it's out of the browser window. I have attached the screenshot, you can see some space around browser. Thanks, – Pandiyan Mar 20 '18 at 04:27