Tag

localStorage

1 views collected around this technical thread.

Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Jun 15, 2025 · Frontend Development

Master Cross‑Tab Communication: BroadcastChannel vs localStorage in JavaScript

Learn how to synchronize data across multiple browser tabs using the native BroadcastChannel API and the fallback localStorage + storage event, with step‑by‑step code examples, usage scenarios, feature comparisons, compatibility notes, and a reusable TabMessenger class for seamless inter‑tab messaging.

BroadcastChannelJavaScriptWeb API
0 likes · 9 min read
Master Cross‑Tab Communication: BroadcastChannel vs localStorage in JavaScript
Sohu Tech Products
Sohu Tech Products
May 28, 2025 · Frontend Development

A One‑Line Guard for Safe localStorage JSON Parsing in Frontend Development

This article explains why naïvely parsing JSON from localStorage often crashes applications, and provides a concise safeJSON wrapper, versioned key strategy, and TypeScript guards to prevent runtime errors and ensure robust frontend data handling.

JSONJavaScriptTypeScript
0 likes · 4 min read
A One‑Line Guard for Safe localStorage JSON Parsing in Frontend Development
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Dec 28, 2024 · Frontend Development

Can sessionStorage Share Data Across Tabs? Experiments and Conclusions

This article explains the differences between localStorage and sessionStorage, demonstrates through code experiments that sessionStorage does not share data across multiple tabs unless the new page is opened via window.open or a link, and summarizes the resulting behavior.

JavaScriptbrowser APIlocalStorage
0 likes · 4 min read
Can sessionStorage Share Data Across Tabs? Experiments and Conclusions
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Dec 6, 2024 · Frontend Development

Customizing localStorage and sessionStorage with Proxy Methods in Frontend Development

This article explains how to override the native localStorage and sessionStorage APIs in JavaScript, providing a flexible proxy layer that supports business‑specific logic, global monitoring, data protection, encryption, and configurable hooks, with practical Vue 3 integration examples.

JavaScriptProxyStorage
0 likes · 12 min read
Customizing localStorage and sessionStorage with Proxy Methods in Frontend Development
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Oct 16, 2024 · Frontend Development

How to Listen to LocalStorage Changes Within the Same Browser Tab: Techniques and Implementations

This article explains why the native storage event only works across different tabs, evaluates traditional polling and proxy approaches, and presents four efficient solutions—including custom StorageEvent, CustomEvent, MessageChannel, and BroadcastChannel—along with practical React and Vue examples for real‑time localStorage monitoring.

JavaScriptReactVue
0 likes · 12 min read
How to Listen to LocalStorage Changes Within the Same Browser Tab: Techniques and Implementations
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Jul 29, 2024 · Frontend Development

Ensuring a Single Token Request Across Multiple API Calls with a repeatOnce Function

This article explains how to prevent multiple simultaneous token requests in a web application by using a custom repeatOnce function that caches the token in localStorage and coordinates pending calls through an event emitter, ensuring only the first request fetches the token while others wait for its result.

AxiosJavaScriptPromise
0 likes · 5 min read
Ensuring a Single Token Request Across Multiple API Calls with a repeatOnce Function
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Dec 4, 2023 · Frontend Development

Cross‑Window Real‑Time Rendering with Canvas, window.screenX/Y and localStorage

This article demonstrates how to create a multi‑window, real‑time interactive animation using pure JavaScript by drawing circles on a canvas, sharing each window's screen coordinates and colors through localStorage, and connecting them with lines across browsers.

JavaScriptanimationcanvas
0 likes · 10 min read
Cross‑Window Real‑Time Rendering with Canvas, window.screenX/Y and localStorage
IT Services Circle
IT Services Circle
Nov 28, 2023 · Frontend Development

A Simplified Front‑End Multi‑Window 3D Scene Using three.js and localStorage

This article explains how a pure‑frontend implementation using three.js and localStorage creates a synchronized 3D scene across multiple browser windows, detailing the project structure, core code files, and the window‑management logic that enables cross‑window coordination without a back‑end.

3DJavaScriptThree.js
0 likes · 13 min read
A Simplified Front‑End Multi‑Window 3D Scene Using three.js and localStorage
Zhuanzhuan Tech
Zhuanzhuan Tech
Aug 1, 2023 · Frontend Development

Understanding and Using localStorage and sessionStorage in Web Development

This article provides a comprehensive overview of browser localStorage and sessionStorage, covering their differences, compatibility, API usage, storage limits, performance tips, and practical applications such as habit tracking, first‑open prompts, and reducing redundant API calls.

JavaScriptfrontendlocalStorage
0 likes · 15 min read
Understanding and Using localStorage and sessionStorage in Web Development
macrozheng
macrozheng
Oct 21, 2021 · Information Security

Where Should You Store JWT in the Browser? Cookie vs localStorage vs sessionStorage

This article compares three browser storage options for JWT—Cookie, localStorage, and sessionStorage—examining their automatic transmission, CSRF and XSS vulnerabilities, and security configurations such as SameSite and HttpOnly to help developers choose the safest method.

CSRFJWTWeb Security
0 likes · 4 min read
Where Should You Store JWT in the Browser? Cookie vs localStorage vs sessionStorage
Code Ape Tech Column
Code Ape Tech Column
Jan 8, 2021 · Information Security

Implementing Single Sign‑On (SSO) in B/S Systems: Cookie, Authentication Center, and LocalStorage Approaches

This article explains how Single Sign‑On works in browser‑server applications, compares three implementation methods—parent‑domain cookies, a dedicated authentication center, and cross‑domain LocalStorage with iframe/postMessage—and provides sample code for the latter technique.

AuthenticationCross-DomainSSO
0 likes · 10 min read
Implementing Single Sign‑On (SSO) in B/S Systems: Cookie, Authentication Center, and LocalStorage Approaches
IT Xianyu
IT Xianyu
Nov 25, 2020 · Backend Development

Implementing Single Sign-On (SSO) in B/S Systems: Cookie, Authentication Center, and LocalStorage Approaches

This article explains three practical SSO implementation methods—using a parent‑domain cookie, deploying an authentication center, and leveraging LocalStorage with iframe/postMessage—to share session IDs or tokens across multiple web applications, discussing their advantages, limitations, and code examples.

Authentication CenterJavaScriptSSO
0 likes · 10 min read
Implementing Single Sign-On (SSO) in B/S Systems: Cookie, Authentication Center, and LocalStorage Approaches
Architecture Digest
Architecture Digest
Oct 18, 2020 · Information Security

Implementing Single Sign-On (SSO) in Web Applications: Cookie, Authentication Center, and LocalStorage Approaches

This article explains the principles of Single Sign-On, compares three implementation methods—parent‑domain cookies, a dedicated authentication center, and cross‑domain LocalStorage with token sharing—and provides code examples and practical considerations for each approach.

AuthenticationSSOWeb Security
0 likes · 10 min read
Implementing Single Sign-On (SSO) in Web Applications: Cookie, Authentication Center, and LocalStorage Approaches
Selected Java Interview Questions
Selected Java Interview Questions
Sep 23, 2020 · Backend Development

Implementing Single Sign-On (SSO) in Web Applications: Cookie, Authentication Center, and LocalStorage Approaches

This article explains three practical methods for achieving Single Sign‑On in web systems—using a parent‑domain cookie, deploying a dedicated authentication center, and leveraging front‑end LocalStorage with iframe postMessage—to share session or token information across multiple domains.

AuthenticationSSOWeb Security
0 likes · 11 min read
Implementing Single Sign-On (SSO) in Web Applications: Cookie, Authentication Center, and LocalStorage Approaches
政采云技术
政采云技术
Oct 20, 2019 · Frontend Development

A Simple Side‑Effect‑Free Same‑Origin Cross‑Page Data Synchronization Solution

This article explains how to use localStorage, sessionStorage, and the storage event to achieve reliable, side‑effect‑free data synchronization between same‑origin web pages, providing a practical implementation with JavaScript code and detailed design considerations.

JavaScriptcross-page communicationfrontend
0 likes · 12 min read
A Simple Side‑Effect‑Free Same‑Origin Cross‑Page Data Synchronization Solution
Architecture Digest
Architecture Digest
Apr 26, 2016 · Frontend Development

Overview of Browser Storage Mechanisms: Cookies, Web Storage, IndexedDB, WebSQL, and More

This article provides a comprehensive overview of common browser storage technologies—including Cookies, Web Storage (localStorage and sessionStorage), IndexedDB, WebSQL, Application Cache, and Service Workers—explaining their purposes, compatibility, and offering practical code examples for each.

IndexedDBWebSQLbrowser storage
0 likes · 15 min read
Overview of Browser Storage Mechanisms: Cookies, Web Storage, IndexedDB, WebSQL, and More