question

LingSteven avatar image
0 Votes"
LingSteven asked ZhiLv-MSFT edited

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

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


ms-edgedotnet-aspnet-core-mvc
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Bruce-SqlWork avatar image
1 Vote"
Bruce-SqlWork answered

For security reasons this feature was removed long ago and never added to edge

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ZhiLv-MSFT avatar image
0 Votes"
ZhiLv-MSFT answered ZhiLv-MSFT edited

Hi @LingSteven,

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.