Cross Domain Local Storage is a lightweight JavaScript library that implements the standard localStorage interface using iframe postMessage communication to share data across subdomains. Current version is 2.0.5. It provides async API with callbacks or promises (v2+), and supports Angular integration. Unlike cookies, it does not send data to the server on every request. However, note that Safari 7+ blocks third-party data, making the library unusable on that browser.
npm install xdlocalstorageNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes cross-domain localStorage, sets and gets an item using callbacks.
Consider using server-side storage or cookies for cross-domain needs on Safari.
Update callbacks to use promise .then() or continue using callbacks as they are still supported.
Ensure the iframe HTML includes the correct script tag for postMessage API.
Always provide a callback or handle promise for read/write operations.
Include the script tag <script src='path/to/xdLocalStorage.min.js'></script> before any xdLocalStorage calls.
Ensure the iframe URL points to a page on the target domain and that both pages use the same protocol (http/https).
Ensure you include xdLocalStorage.min.js (not the PostMessage API script) on the client page and call init with correct config.
No dependency data recorded yet.