All Projects → krakenjs → cross-domain-safe-weakmap

krakenjs / cross-domain-safe-weakmap

Licence: Apache-2.0 license
Cross-domain safe WeakMap shim

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Cross Domain Safe WeakMap

build status code coverage npm version apache license

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

Installation

As of version 2 this package will be published under the @krakenjs scope.

npm install @krakenjs/cross-domain-safe-weakmap

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].