fix: read Grok usage from grok.com pages (0.4.4) - #13
Merged
Merged
Conversation
Cloudflare 403s extension-background grok.com requests. Inject self-contained MAIN-world fetches, use a two-step stash, and surface page-probe errors instead of falling back to the worker. Treat an omitted SuperGrok credit_usage_percent as 0% used. Co-authored-by: wjcjttl9 <wjcjttl9@gmail.com>
TiantianFlow
marked this pull request as ready for review
August 26, 2026 02:51
Patch release for the Grok page-probe usage fix. Co-authored-by: wjcjttl9 <wjcjttl9@gmail.com>
Contributor
|
Thanks @catfish-xn — the report on #9 and the diagnosis were a huge help. Cloudflare 403 on the background fetch, Merged as 0.4.4. GitHub closed #9 automatically via After updating, please reconnect Grok so the extension can request If anything still fails on 0.4.4 after reconnect, comment on #9 and we can reopen. 感谢你把原因和复现写得这么清楚。 |
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
Grok usage in the sidebar failed on ~v0.4.2 because the background worker
fetchto grok.com is blocked by Cloudflare (403 HTML when Origin is not grok.com), and the previous page-inject helper crashed onexecuteScriptreturningnull. This PR reads session, usage, subscriptions, and rate-limits from a logged-in grok.com tab in the MAIN world instead, and treats omitted SuperGrokcredit_usage_percentas 0% of the weekly pool.Release version is 0.4.4.
What changed
page-probe:health messages when inject fails; empty vs throw are named separately.credit_usage_percentwith a valid period →usedRatio: 0(weekly pool still preferred).scripting+https://grok.com/*. Interactive refresh may open an inactive grok.com tab; scheduled refresh only injects existing tabs.Tests
pnpm test:run, typecheck, andpnpm buildpassed locally.Closes #9.