Skip to content

Lyt 133: Pinning domain sometimes throws an uncaught cross-origin SecurityError#134

Merged
anupsingh244 merged 2 commits into
mainfrom
lyt-133
Jul 2, 2026
Merged

Lyt 133: Pinning domain sometimes throws an uncaught cross-origin SecurityError#134
anupsingh244 merged 2 commits into
mainfrom
lyt-133

Conversation

@anupsingh244

Copy link
Copy Markdown
Contributor

closes: #133
This pull request introduces several improvements and bug fixes across the codebase, focusing on safer event serialization, more robust script injection, and better resource management. The most significant changes are grouped below.

Event Serialization & Error Handling:

  • Added a safeClone method in both tagLink.js and tagLink.tsx to safely serialize event payloads, avoiding issues with circular references, non-plain objects, and unreadable properties. Event dispatching now uses this method, with error logging if serialization fails. [1] [2]
  • Wrapped calls to dispatchEvent in try/catch blocks when handling config and entity events, logging errors if reading or serializing data fails. [1] [2] [3] [4]

Script Injection & Caching:

  • Modified script injection to append a build-specific query parameter to tagLink.js's URL, ensuring cache busting after extension updates. The build ID is injected at build time using Vite's define option. [1] [2]
  • Updated related test to expect the new cache-busting URL format.

Resource & State Management:

  • Limited the number of stored tag activity events per domain to 200, preventing unbounded growth and potential performance issues. [1] [2]

UI Improvements:

  • Updated the TagActivity accordion to use a stable key (item.ts) and enabled unmounting on exit for better React performance.

Miscellaneous:

  • Updated the extension title in package.json to "Lytics Dev Tools" for consistency.

@anupsingh244
anupsingh244 merged commit c0e6b7d into main Jul 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Pinning domain sometimes throws an uncaught cross-origin SecurityError

2 participants