From b925a7b75f3de0acd75b0592f31c222144fbb432 Mon Sep 17 00:00:00 2001 From: David Newell Date: Thu, 17 Oct 2024 14:31:29 +0100 Subject: [PATCH] chore: add crossOrigin='anonymous' to snippet script (#1481) --- playground/cypress-full/index.html | 2 +- playground/cypress/index.html | 2 +- playground/segment/segment.html | 2 +- playground/session-recordings/index.html | 1 + playground/snippet/index.html | 3 ++- src/entrypoints/external-scripts-loader.ts | 1 + 6 files changed, 7 insertions(+), 4 deletions(-) diff --git a/playground/cypress-full/index.html b/playground/cypress-full/index.html index a55faa495..6e06796a5 100644 --- a/playground/cypress-full/index.html +++ b/playground/cypress-full/index.html @@ -47,7 +47,7 @@
diff --git a/playground/cypress/index.html b/playground/cypress/index.html index eb6604037..9ae94c58f 100644 --- a/playground/cypress/index.html +++ b/playground/cypress/index.html @@ -57,7 +57,7 @@ diff --git a/playground/segment/segment.html b/playground/segment/segment.html index 226bdfc58..f060d6720 100644 --- a/playground/segment/segment.html +++ b/playground/segment/segment.html @@ -5,7 +5,7 @@ diff --git a/src/entrypoints/external-scripts-loader.ts b/src/entrypoints/external-scripts-loader.ts index 7748292d2..0a612f267 100644 --- a/src/entrypoints/external-scripts-loader.ts +++ b/src/entrypoints/external-scripts-loader.ts @@ -14,6 +14,7 @@ const loadScript = (posthog: PostHog, url: string, callback: (error?: string | E } const scriptTag = document.createElement('script') scriptTag.type = 'text/javascript' + scriptTag.crossOrigin = 'anonymous' scriptTag.src = url scriptTag.onload = (event) => callback(undefined, event) scriptTag.onerror = (error) => callback(error)