@readium/navigator 2.3.0 → 2.3.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@readium/navigator",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "type": "module",
5
5
  "description": "Next generation SDK for publications in Web Apps",
6
6
  "author": "readium",
@@ -282,6 +282,7 @@ export class DevToolsDetector {
282
282
  // Cleanup Web Worker
283
283
  if (this.workerConsole) {
284
284
  this.workerConsole.destroy();
285
+ this.workerConsole = undefined;
285
286
  }
286
287
 
287
288
  this.isOpen = false;
@@ -129,8 +129,12 @@ export class WebPubNavigator extends VisualNavigator implements Configurable<Web
129
129
 
130
130
  // Listen for custom events from NavigatorProtector
131
131
  this._suspiciousActivityListener = (event: Event) => {
132
- const customEvent = event as CustomEvent;
133
- this.listeners.contentProtection(customEvent.detail.type, customEvent.detail);
132
+ const { type, ...activity } = (event as CustomEvent).detail;
133
+ if (type === "context_menu") {
134
+ this.listeners.contextMenu(activity as ContextMenuEvent);
135
+ } else {
136
+ this.listeners.contentProtection(type, activity);
137
+ }
134
138
  };
135
139
  window.addEventListener(NAVIGATOR_SUSPICIOUS_ACTIVITY_EVENT, this._suspiciousActivityListener);
136
140
  }