@mml-io/3d-web-client-core 0.0.0-experimental-27180bc-20240609 → 0.0.0-experimental-bc97b49-20240609

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.
@@ -27,7 +27,7 @@ export type CharacterManagerConfig = {
27
27
  username: string;
28
28
  characterDescription: CharacterDescription;
29
29
  };
30
- updateLocationHash?: boolean;
30
+ updateURLLocation?: boolean;
31
31
  };
32
32
  export declare class CharacterManager {
33
33
  private config;
package/build/index.js CHANGED
@@ -2316,11 +2316,14 @@ var CharacterManager = class {
2316
2316
  this.remoteCharacterControllers.delete(id);
2317
2317
  }
2318
2318
  }
2319
- if (this.config.updateLocationHash && this.config.timeManager.frame % 60 === 0) {
2320
- window.location.hash = encodeCharacterAndCamera(
2319
+ if (this.config.updateURLLocation && this.config.timeManager.frame % 60 === 0 && document.hasFocus()) {
2320
+ const hash = encodeCharacterAndCamera(
2321
2321
  this.localCharacter,
2322
2322
  this.config.cameraManager.camera
2323
2323
  );
2324
+ const url = new URL(window.location.href);
2325
+ url.hash = hash;
2326
+ window.history.replaceState({}, "", url);
2324
2327
  }
2325
2328
  }
2326
2329
  }