From c746b081afbed33e8ad90fa17a0657ff8cf332cd Mon Sep 17 00:00:00 2001 From: Kathryn Beaty Date: Fri, 28 Jun 2024 12:38:47 -0400 Subject: [PATCH 1/2] grab the ORIGIN from the count.js script src --- client/src/core/client/count/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/src/core/client/count/index.ts b/client/src/core/client/count/index.ts index 33d05faa65..6226672fc6 100644 --- a/client/src/core/client/count/index.ts +++ b/client/src/core/client/count/index.ts @@ -1,6 +1,5 @@ import { COUNT_SELECTOR } from "coral-framework/constants"; import detectCountScript from "coral-framework/helpers/detectCountScript"; -import getCurrentScriptOrigin from "coral-framework/helpers/getCurrentScriptOrigin"; import resolveStoryURL from "coral-framework/helpers/resolveStoryURL"; import jsonp from "coral-framework/utils/jsonp"; @@ -23,7 +22,11 @@ interface DetectAndInjectArgs { /** Detects count elements and use jsonp to inject the counts. */ function detectAndInject(opts: DetectAndInjectArgs = {}) { - const ORIGIN = getCurrentScriptOrigin(); + // Get ORIGIN from the count.js script that we know will be on the page. + const ORIGIN = document + .querySelector(".coral-script") + ?.getAttribute("src") + ?.split("/assets")[0]; const STORY_URL = resolveStoryURL(window); /** A map of references pointing to the count query arguments */ From ce2e09b0aaab8fef8cb33ac5236045ea3f447020 Mon Sep 17 00:00:00 2001 From: Tessa Thornton Date: Tue, 2 Jul 2024 08:39:01 -0400 Subject: [PATCH 2/2] update package to 9.0.8 --- client/package.json | 2 +- common/package.json | 2 +- config/package.json | 2 +- server/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/package.json b/client/package.json index 9539c18bb3..dd29b766fa 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "@coralproject/talk", - "version": "9.0.7", + "version": "9.0.8", "author": "The Coral Project", "homepage": "https://coralproject.net/", "sideEffects": [ diff --git a/common/package.json b/common/package.json index 36a85ae064..926e21178d 100644 --- a/common/package.json +++ b/common/package.json @@ -1,6 +1,6 @@ { "name": "common", - "version": "9.0.7", + "version": "9.0.8", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/config/package.json b/config/package.json index 93cddc8f28..31a274369b 100644 --- a/config/package.json +++ b/config/package.json @@ -1,6 +1,6 @@ { "name": "common", - "version": "9.0.7", + "version": "9.0.8", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/server/package.json b/server/package.json index ce76c43679..d6b1529f41 100644 --- a/server/package.json +++ b/server/package.json @@ -1,6 +1,6 @@ { "name": "@coralproject/talk", - "version": "9.0.7", + "version": "9.0.8", "author": "The Coral Project", "homepage": "https://coralproject.net/", "sideEffects": [