Add cross-browser extension support via window.postMessage bridge#326
Open
HarmlessHarm wants to merge 10 commits intodevelopfrom
Open
Add cross-browser extension support via window.postMessage bridge#326HarmlessHarm wants to merge 10 commits intodevelopfrom
HarmlessHarm wants to merge 10 commits intodevelopfrom
Conversation
- Refactor extension detection/utilities and store references for Chrome, Firefox, and Edge - Update UI copy, URLs, and logic to reflect broader browser support - Replace old Chrome-only references/logic with multi-browser dynamic logic everywhere in code and UI - Update privacy policy and docs to reflect browser-agnostic support
Replace direct chrome.runtime.sendMessage calls with a window.postMessage bridge pattern that works across Chrome, Firefox, and Edge. Remove hard-coded extension IDs and the browser-dependent getExtensionId() function.
Add checkExtensionInstalled action to general.js store that calls the bridge once and caches the result (null → not checked, false → absent, string → version). Subsequent calls return immediately from state. Guard sync_player in players.js with rootState check so it throws early rather than waiting on the bridge when the extension is not present. Update all four callers (CharacterSync, RunCampaign, Players, ContentSideRight) to dispatch checkExtensionInstalled instead of calling the utility directly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both target="_blank" links pointing to the browser extension stores used rel="noopener" but were missing "noreferrer", which prevents the Referer header from leaking to the destination. The :href="storeUrl" binding is safe — storeUrl always returns one of three hardcoded HTTPS URLs from the frozen character_sync_stores constant and has no user-controlled input. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace string comparison with proper semantic version parsing to correctly compare version numbers (e.g., "0.2.10" > "0.2.1"). Add compareVersions() helper function that splits and compares major, minor, and patch versions.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
chrome.runtime.sendMessagewith awindow.postMessagebridge protocol, enabling the D&D Character Sync extension to work in Chrome, Firefox, and EdgegetExtensionId,character_sync_chrome/firefox/edge_idconstants)checkExtensionInstalledVuex action that caches the result of the bridge check, so the 2-second timeout is only incurred once per session instead of on every page/component mountsync_playerin the players store to bail out immediately if the extension is known to be absentTest plan (on staging)
extensionInstalledcheck returns a version string and character sync features are accessibleundefined/{}after the 2-second timeout, with no further bridge calls on navigationsync_player) without the extension installed — action throws immediately without hitting the bridge🤖 Generated with Claude Code