File tree Expand file tree Collapse file tree
src/vs/platform/lifecycle/browser Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ import { ILogService } from 'vs/platform/log/common/log';
88import { AbstractLifecycleService } from 'vs/platform/lifecycle/common/lifecycleService' ;
99import { localize } from 'vs/nls' ;
1010import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation' ;
11- import { addDisposableListener , EventType } from 'vs/base/browser/dom' ;
1211
1312export class BrowserLifecycleService extends AbstractLifecycleService {
1413
@@ -23,7 +22,9 @@ export class BrowserLifecycleService extends AbstractLifecycleService {
2322 }
2423
2524 private registerListeners ( ) : void {
26- addDisposableListener ( window , EventType . BEFORE_UNLOAD , ( ) => this . onBeforeUnload ( ) ) ;
25+ // Note: we cannot change this to window.addEventListener('beforeUnload')
26+ // because it seems that mechanism does not allow for preventing the unload
27+ window . onbeforeunload = ( ) => this . onBeforeUnload ( ) ;
2728 }
2829
2930 private onBeforeUnload ( ) : string | null {
You can’t perform that action at this time.
0 commit comments