firefox-csshacks
firefox-csshacks copied to clipboard
Can the close button be disabled?
This is a crazy question and apologies if it is outside the scope of these CSS hacks.
I'm looking for a way to prevent accidental closure of a single-tab browser window. There is a nice AHK script/app called NoClose that will disable the close button for windows using standard (Windows) system window controls. It works in Windows for Firefox if the title bar is displayed. It doesn't prevent closure in numerous other ways, but does stop accidental clicks on the "X" in the corner.
Could something similar be done for Firefox using CSShacks when the title bar isn't displayed and/or in non-Windows?
Thanks!
Certainly, you can simply use .titlebar-close{ display: none }
Is that something that can be toggled on/off without a restart or possibly even per window?
You can't achieve something like that with simply CSS. You could have an extension that toggles some specific window title for specific window if you like, and then use the existence of that window title prefix as a condition in your CSS to determine if the window close button should be hidden for that window. But yes, you would need an extension for that
Got it. Not sure I want to learn how to make extensions just for this, but it's good to know.
Thanks!