JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 68886
  • Score
    100M100P100Q272496F

Cross domain safe WeakMap.

Package Exports

  • cross-domain-safe-weakmap
  • cross-domain-safe-weakmap/src

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cross-domain-safe-weakmap) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Cross Domain Safe WeakMap

WeakMap shim that works with cross-domain windows. Uses native WeakMap when available.

Rationale

Storing references to window objects is memory-expensive, even after those window objects have closed.

Existing WeakMap shims hang an object of the WeakMap key. This poses a problem when dealing with cross-domain windows, where setting or getting any key other than a pre-defined set of readonly values, will throw a cross-origin error.