Add use-credentials option to gatsby-plugin-manifest to allow cookies to be sent by Chrome #11877
Labels
good first issue
Issue that doesn't require previous experience with Gatsby
help wanted
Issue with a clear description that the community can help with.
Summary
We're about to launch a pilot of our college's new Gatsby-generated front page. The first deployment will be controlled by an opt-in cookie that we are sharing with several on-campus volunteers. We discovered that the gatsby-plugin-manifest plugin is generating our tag to the manifest file properly, but the request from Chrome for the manifest file is sent without cookies or authentication headers by default. This means the request 404s even with our preview cookie set.
We learned about this Chrome restriction from this GitHub comment:
w3c/manifest#535 (comment)
Basic example
We envision a configuration flag like this:
That would result in a link tag like this:
Motivation
We'd like a visitor's cookies to be sent with the manifest file request by all browsers, including Chrome. We aren't using authentication, but if a PWA did rely on authentication, we imagine this would be a helpful feature, too.
Admittedly, we don't think many people would need this, and we'd probably remove it after we launch the site officially, so the default behavior should continue to be to exclude the crossOrigin/use-credentials attribute.
All this being said, it is possible for us to manually direct the request to the correct backend node in our load balancer. We understand if this issue is ultimately closed without implementation, but hopefully future Gatsby developers will see this issue and understand what's happening with Chrome. :)
The text was updated successfully, but these errors were encountered: