src/vs/workbench/services/lifecycle/browser/lifecycleService.ts/BrowserLifecycleService/onBeforeUnload
class BrowserLifecycleService:	private onBeforeUnload(event: BeforeUnloadEvent): void {
		if (this.expectedUnload) {
			this.logService.info('[lifecycle] onBeforeUnload expected, ignoring once');

			this.expectedUnload = false;

			return; // ignore expected unload only once
		}

		this.logService.info('[lifecycle] onBeforeUnload triggered');

		this.doShutdown(() => {

			// Veto handling
			event.preventDefault();
			event.returnValue = localize('lifecycleVeto', "Changes that you made may not be saved. Please check press 'Cancel' and try again.");
		});
	}