Enable cross-origin manifest to make PWA work behind Cloudflare Access (#734)
* feat: add crossOrigin use-credentials to PWA manifest link for Cloudflare Access compatibility * docs: add inline comment explaining crossOrigin use-credentials on manifest link Co-authored-by: arthurfiorette <47537704+arthurfiorette@users.noreply.github.com>
This commit is contained in:
@@ -198,6 +198,9 @@
|
||||
|
||||
const manifestLink = document.createElement('link');
|
||||
manifestLink.rel = 'manifest';
|
||||
// Required so the browser sends auth cookies when fetching the manifest,
|
||||
// enabling PWA installation behind authentication proxies (e.g. Cloudflare Access).
|
||||
manifestLink.crossOrigin = 'use-credentials';
|
||||
document.head.appendChild(manifestLink);
|
||||
|
||||
let activeManifestBlobUrl = null;
|
||||
|
||||
Reference in New Issue
Block a user