Close the window right away when
true, else check if we can unload.
Lock to prevent multiple parallel executions of the
Notify the browser that we do not want to unload.
The beforeunload event
beforeunload on Electron, no popup is shown.
This method implements a modal to ask the user if he wants to quit the page.
Updates the window zoom level based on the preference value.