Repository navigation
fix: restore embedded Grok conversations and cookie consent - #88
Merged
Merged
Conversation
Address review findings on the embedded Grok cookie forwarding: - Only accept sync requests from the top frame of the extension's own Multi-Panel page, derive tabs from runtime.getContexts (frameId 0) and add a topDomains condition when supported, so a website framing the web-accessible Multi-Panel page no longer receives Grok session cookies. - Drop a tab from the rule as soon as it starts navigating and only re-admit it after a new sync request, avoiding duplicate cookies (401) after the tab leaves the Multi-Panel page. - Route every reconcile through one coalescing service worker scheduler instead of reconciling from the page, and propagate failures. - Upgrade consent cookies only on an explicit Multi-Panel sync request. - Reconcile on tab removal and cookie changes only when relevant. - Sync before the panel limit check in addPanel so concurrent adds cannot exceed MAX_PANELS. - Patch the prototype that owns document.cookie and run the consent script only inside extension pages. Claude-Session: https://claude.ai/code/session_01W5d9xkwrKRHCwLGjgnvYQn
Merged
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.
Closes #85.
Grok loads in Panelize but cannot start a conversation because Chromium omits its SameSite session cookies from embedded WebSocket handshakes. Restore authenticated connections and preserve the user's cookie consent choice across panel refreshes.
Changes
declarativeNetRequestrule restricted to Grok WebSockets initiated by Grok in Multi-Panel tabs. Preserve cookies Chromium already sends and leave standalone Grok tabs outside the rule.SameSite=None; Secure. Apply the same attributes to future writes of those two cookies in embedded Grok frames, so the user's choice survives refreshes.cookiesandwss://grok.com/*permissions and document both uses of cookie access in the privacy policy.Validation
session.createdandresponse.done). The user also confirmed that sending messages and retaining cookie consent now work.npx vitest run --maxWorkers=1 --silent: 414 tests passed across 45 files. The initial parallel run had one ChatGPT idle-status test failure; its focused rerun and the serial full suite passed.npx playwright test tests/e2e/grok-websocket.e2e.test.js: passed during targeted validation.npm run test:e2e: 36/37 passed, including the Grok WebSocket regression. Qwen's test stopped during extension-copy setup with anENOENTfor Chromium's generated_metadatadirectory;npx playwright test tests/e2e/qwen-auth.e2e.test.jsthen passed on its own.web-ext lint: 8 errors, all reproduced onorigin/main; no new errors. Existing errors concern Firefox manifest compatibility and parsing Node scripts as extension code.The branch starts at
8786521onmain, which already includes the Qwen fix from #87, and contains only the Grok fix commit.