@magic-xpa/angular 4.1300.0-dev4130.273 → 4.1300.0-dev4130.275

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6146,10 +6146,17 @@ class MagicShellComponent {
6146
6146
  this.magicEngineTerminated = true;
6147
6147
  }
6148
6148
  }
6149
- onUnload(event) {
6149
+ /**
6150
+ * Page-hide event listener, used in place of 'unload'.
6151
+ * Chrome blocks 'unload' by permissions policy ("unload is not allowed in this document"),
6152
+ * so an unload handler is never even registered. 'pagehide' is fired at an earlier step of
6153
+ * the same unloading sequence, so it covers every case 'unload' did.
6154
+ */
6155
+ onPageHide() {
6150
6156
  // Chrome provides an opportunity to terminate the context after user approves the browser unload alert
6151
- if (!this.magicEngineTerminated)
6157
+ if (!this.magicEngineTerminated) {
6152
6158
  this.engineMagicService.TerminateContextUsingFetchAPI();
6159
+ }
6153
6160
  }
6154
6161
  ngAfterViewInit() {
6155
6162
  this.overlayWindowService.init(this.overlayWindowsContainerViewRef, this.rootMagicElementRef().nativeElement, this.changeDetectorRef);
@@ -6272,7 +6279,7 @@ class MagicShellComponent {
6272
6279
  } if (rf & 2) {
6273
6280
  i0.ɵɵqueryAdvance();
6274
6281
  } }, hostBindings: function MagicShellComponent_HostBindings(rf, ctx) { if (rf & 1) {
6275
- i0.ɵɵlistener("beforeunload", function MagicShellComponent_beforeunload_HostBindingHandler($event) { return ctx.onBeforeUnload($event); }, i0.ɵɵresolveWindow)("unload", function MagicShellComponent_unload_HostBindingHandler($event) { return ctx.onUnload($event); }, i0.ɵɵresolveWindow);
6282
+ i0.ɵɵlistener("beforeunload", function MagicShellComponent_beforeunload_HostBindingHandler($event) { return ctx.onBeforeUnload($event); }, i0.ɵɵresolveWindow)("pagehide", function MagicShellComponent_pagehide_HostBindingHandler() { return ctx.onPageHide(); }, i0.ɵɵresolveWindow);
6276
6283
  } }, inputs: { SpinnerTemplate: [1, "SpinnerTemplate"] }, standalone: false, features: [i0.ɵɵProvidersFeature([
6277
6284
  // ExitMagicService
6278
6285
  ])], decls: 8, vars: 2, consts: [["magicRoot", ""], ["overlayWindowsContainer", ""], ["defaultSpinner", ""], [3, "ndcDynamicComponent", "ndcDynamicInputs"], ["magicViewContainerRef", ""], [1, "spinner-background"], [3, "ngTemplateOutlet"], [1, "mgSpinnerClass"]], template: function MagicShellComponent_Template(rf, ctx) { if (rf & 1) {
@@ -6319,9 +6326,9 @@ class MagicShellComponent {
6319
6326
  }], () => [], { rootMagicElementRef: [{ type: i0.ViewChild, args: ['magicRoot', { isSignal: true }] }], SpinnerTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "SpinnerTemplate", required: false }] }], onBeforeUnload: [{
6320
6327
  type: HostListener,
6321
6328
  args: ['window:beforeunload', ['$event']]
6322
- }], onUnload: [{
6329
+ }], onPageHide: [{
6323
6330
  type: HostListener,
6324
- args: ['window:unload', ['$event']]
6331
+ args: ['window:pagehide']
6325
6332
  }] }); })();
6326
6333
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicShellComponent, { className: "MagicShellComponent", filePath: "src/ui/magic-root.component.ts", lineNumber: 90 }); })();
6327
6334