Repository navigation
fix: switch Steam web API token reading to cookies API - #425
Merged
Merged
Conversation
GODrums
approved these changes
Nov 27, 2026
…ox first-party isolation
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.
Ref CSF-2340
Why
5.19.3 renewed the Steam store session to read the web API token from the store. On Firefox, the store can't refresh its own session after a steamcommunity.com login, since Firefox keeps the login cookie it needs out of the store's reach, so renewal fails there too.
What changed
The extension loads steamcommunity.com, which lets Steam refresh the login when needed, then reads the token from the
steamLoginSecurecookie. This adds thecookiespermission, which Chrome and Firefox don't warn about on update.Expired tokens are rejected by checking
expagainst theDateheader on Steam's response, since the user's clock can be off.The 5.19.3 store renewal and its header rules are removed. Firefox still removes the old rule IDs, since dynamic rules survive updates.
Tests
Cover reading the cookie after the page load, account mismatches, missing cookies, expired tokens and a drifted local clock.
Note
Medium Risk
Changes how the extension obtains Steam web API credentials (cookies + session refresh), which affects all callers of
getAccessToken, though the removed store renewal path was already failing on Firefox.Overview
Replaces the Steam store session renewal flow (
ajaxgetasyncconfig,jwt/ajaxrefresh,login/settoken) with loadingsteamcommunity.comso Steam can refresh the session, then reading the JWT from thesteamLoginSecurecookie via thecookiespermission.Caching now tracks
expires_atand only reuses tokens with more than 5 minutes left; expiry is checked against the responseDateheader so a wrong local clock or a stale cookie JWT is rejected. Firefox retries cookie lookup withfirstPartyDomainwhen first-party isolation requires it.The 5.19.3 store renewal DNR header rules and
LAST_STORE_SESSION_RENEWAL_ATTEMPTstorage are removed; Firefox still strips the old dynamic rule IDs on update.Reviewed by Cursor Bugbot for commit 889fc99. Bugbot is set up for automated code reviews on this repo. Configure here.