@kalayanasundaram123/rrweb 2.0.1 → 2.0.2

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.
@@ -13985,6 +13985,13 @@ function WorkerWrapper(options) {
13985
13985
  objURL && (self.URL || self.webkitURL).revokeObjectURL(objURL);
13986
13986
  }
13987
13987
  }
13988
+ function canCreateBlobWorker(win) {
13989
+ try {
13990
+ return typeof Worker !== "undefined" && win.origin != null && win.origin !== "null";
13991
+ } catch (e2) {
13992
+ return false;
13993
+ }
13994
+ }
13988
13995
  class CanvasManager {
13989
13996
  constructor(options) {
13990
13997
  __publicField(this, "pendingCanvasMutations", /* @__PURE__ */ new Map());
@@ -14015,7 +14022,7 @@ class CanvasManager {
14015
14022
  this.mutationCb = options.mutationCb;
14016
14023
  this.mirror = options.mirror;
14017
14024
  this.options = options;
14018
- if (recordCanvas && typeof sampling === "number") {
14025
+ if (recordCanvas && typeof sampling === "number" && canCreateBlobWorker(win)) {
14019
14026
  this.worker = this.initFPSWorker();
14020
14027
  }
14021
14028
  this.addWindow(win);
@@ -14023,7 +14030,7 @@ class CanvasManager {
14023
14030
  this.startRAFTimestamping();
14024
14031
  this.startPendingCanvasMutationFlusher();
14025
14032
  }
14026
- if (recordCanvas && typeof sampling === "number") {
14033
+ if (recordCanvas && typeof sampling === "number" && this.worker) {
14027
14034
  this.initCanvasFPSObserver();
14028
14035
  }
14029
14036
  }