Skip to content

Carry cookies into a cold-started Grab - #46

Merged
Linuxuser67 merged 3 commits into
mainfrom
fix/cold-start-cookie-handoff
Oct 27, 2026
Merged

Linuxuser67 merged 3 commits into
mainfrom
fix/cold-start-cookie-handoff

Conversation

@Linuxuser67

@Linuxuser67 Linuxuser67 commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

When Grab is closed, the HTTP handoff fails and the previous code fell back to the grab:// URL. That channel cannot carry cookies, so Grab started with none and sites that need a logged-in browser (simpcity and similar) failed authentication.

This change:

  • wakes Grab through grab://https/, which launches it without opening a download card;
  • only does so when a retry can actually carry cookies: not incognito, a saved pairing code, the Cookies permission, and at least one cookie for the site;
  • shows a "Starting Grab…" toolbar badge while waiting, leaving an existing warning badge untouched;
  • shares one in-flight wake between concurrent sends, so a burst produces one launch;
  • polls /hello until the listener proves the pairing (12 s cap);
  • retries the POST so the browser cookies still travel;
  • uses the cookieless grab:// fallback immediately in every skipped case.

Tests cover wake-and-retry (cookies present, badge shown and cleared, acted-on tab), the timeout fallback, the unpaired and permission-revoked gates, incognito, cookie-less sites, warning-badge preservation, and a concurrent burst producing one wake navigation. Full suite: 183 passing.

Builds on the merged #45.

When the local server refuses the handoff, navigate to a wake URL that
launches Grab without a download, poll until it proves the pairing, then
retry the POST so the cookies still travel. Fall back to the cookieless
grab:// URL only when Grab never comes up.
Only wake when the retry can carry cookies: a paired Grab and the Cookies
permission are both required, so unpaired or revoked users fall back
immediately as before. Show a starting badge while waiting, and let
concurrent sends await one in-flight wake instead of launching repeatedly.
Only wake when the tab is not incognito, Grab is paired, the Cookies
permission is granted, and the site actually has cookies to send. A warned
tab keeps its existing badge instead of having it replaced and cleared.
Reads the pairing code once.
@Linuxuser67
Linuxuser67 merged commit f70ef67 into main Oct 27, 2026
2 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.

1 participant