Fix: add fcm/autopush host_permissions so 'Send test push' isn't CORS-blocked#5
Merged
Conversation
…t CORS-blocked The "Send test push" button failed with a generic "Failed to fetch" because the SW's fetch to https://fcm.googleapis.com/... was getting CORS-blocked. The manifest grants *.google.com but NOT *.googleapis.com, and FCM lives at fcm.googleapis.com. Adds the three major web-push service hosts to host_permissions: - https://fcm.googleapis.com/* (Chrome / Edge) - https://updates.push.services.mozilla.com/* (Firefox) - https://web.push.apple.com/* (Safari) Also improves error reporting in sendWebPush: - On fetch throw: surfaces the message + a hint about host_permission - On non-2xx: includes the status code AND truncated response body so the dashboard shows what FCM actually said instead of just "failed" Adds a Playwright regression test that injects a fake FCM endpoint and clicks "Send test push", then asserts the dashboard does NOT show "fetch failed" / "Failed to fetch" — only a real push-service status. Reload via Load unpacked (full remove + re-add) since host_permissions changed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
The Send test push button was failing because the SW's fetch to `fcm.googleapis.com` was CORS-blocked — manifest granted `.google.com` but not `.googleapis.com`.
Adds the three major web-push service hosts:
Also surfaces real errors from `sendWebPush` (status code + response body) instead of generic "failed", and adds a Playwright regression test that asserts the request reaches FCM (any HTTP status) rather than being CORS-blocked.
7/7 tests pass.
🤖 Generated with Claude Code