How to disable the maximize button when calling 'window.open()'?

Xie Steven 811 Reputation points
2021-11-01T07:29:09.91+00:00

Hi,

I'm using 'window.open()' method to open a new window to show a page, but I found that the 'Resizable=no' option did not work.

$("#open").click(function () {
                var width = 600;
                var height = 800;
                var left = (screen.width - width) / 2;
                var top = (screen.height - height) / 2;
                var win = window.open('./Home/Update', 'updatePage',
                    'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',scrollbars=no,location=no, menubar=no,Resizable=no');
            });

Does the Edge support the 'Resizable=no' option? If not, is there any ways to disable the maximize button when open a new window?

Thanks,
Steven

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,151 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,209 questions
0 comments No comments
{count} votes

1 additional answer

Sort by: Most helpful
  1. Zhi Lv - MSFT 32,021 Reputation points Microsoft Vendor
    2021-11-02T02:02:58.48+00:00

    Hi @Xie Steven ,

    Agree with Bruce, we can't disable the minimize and maximize buttons in the browsers.

    As an alternative workaround, you could consider using the Bootstrap Modal or JQuery UI dialog to display the page content. You can use JQuery.Get method to get the page content, then append the response html to the Bootstrap Modal body or the dialog body, finally use JavaScript method to show the modal or the dialog. In this case, there are no minimize and maximize buttons.

    0 comments No comments