How to disable maximise option in browser using javascript. I have tried the below code but is not working in some browsers. Is there any other option?
function onReady() {
window.open("https://www.google.com.au","myWindow","resizable=no");
}
Open Google Chrome. Enter chrome://flags in the address bar. Search for "Touch UI Layout" Ensure Touch UI is disabled or set to default.
No, you can't disable the close button on any web site. This would be a major security concern. You can, however, use onbeforeunload to ask the user if they really want to leave, but they can still continue to close the window if they desire.
You probably can't do that anymore.
According to MDN, the dialog
option will do that, but it will only remove the buttons, not the menu commands for it.
function onReady() {
window.open("https://www.google.com.au","myWindow","dialog=yes,resizable=no");
}
But, you can only use it with "Chrome" privileges, which you probably don't have.
Also be aware that if you're calling this in response to jQuery's ready
pseudo-event as the name of the function implies, at least some browsers will prevent your code from opening that window because it's not in direct response to a user event. But if you're calling it in response to a user event, that's not an issue.
You cannot (consistently). Deliberately malicious actions are generally restricted by browsers.
But what You can do is..
window.open("mypage.html","mywindowname", "toolbar=no,menubar=no");
WIll give you a new window without the menubar and without the toolbar. If you just want to disable the functionality while still showing the buttons, then you can't.
Look Here for a reference on the window.open() method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With