From dab5bc8faee1897ff0ae237d6261114a26002cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Aaron?= Date: Tue, 9 May 2023 14:51:57 +0200 Subject: [PATCH 1/2] fix: add window.location.origin to postMessage --- src/extension/content-script/onend.js | 2 +- src/extension/content-script/onendnostr.js | 2 +- src/extension/providers/postMessage.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/extension/content-script/onend.js b/src/extension/content-script/onend.js index 7a0dbc7815..8def1cedca 100644 --- a/src/extension/content-script/onend.js +++ b/src/extension/content-script/onend.js @@ -119,7 +119,7 @@ function postMessage(ev, response) { data: response, scope: "webln", }, - "*" + window.location.origin ); } diff --git a/src/extension/content-script/onendnostr.js b/src/extension/content-script/onendnostr.js index e0d6ad44c5..23978becd6 100644 --- a/src/extension/content-script/onendnostr.js +++ b/src/extension/content-script/onendnostr.js @@ -109,7 +109,7 @@ function postMessage(ev, response) { data: response, scope: "nostr", }, - "*" + window.location.origin ); } diff --git a/src/extension/providers/postMessage.ts b/src/extension/providers/postMessage.ts index 8ceed30c92..c3c84843a8 100644 --- a/src/extension/providers/postMessage.ts +++ b/src/extension/providers/postMessage.ts @@ -17,7 +17,7 @@ export function postMessage( scope: scope, args, }, - "*" // TODO use origin + window.location.origin ); function handleWindowMessage(messageEvent: MessageEvent) { From 95bba1ecda3921ffe6a2fc925cecd1f3a0212204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Aaron?= Date: Fri, 4 Aug 2023 21:58:26 +0200 Subject: [PATCH 2/2] fix: update targetOrigin --- src/extension/content-script/onendalby.js | 2 +- src/extension/content-script/onendwebbtc.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/extension/content-script/onendalby.js b/src/extension/content-script/onendalby.js index 35f095bbfc..fe454dc2b0 100644 --- a/src/extension/content-script/onendalby.js +++ b/src/extension/content-script/onendalby.js @@ -97,7 +97,7 @@ function postMessage(ev, response) { data: response, scope: "alby", }, - "*" + window.location.origin ); } diff --git a/src/extension/content-script/onendwebbtc.js b/src/extension/content-script/onendwebbtc.js index ffec3824b2..0c7dd6d9c5 100644 --- a/src/extension/content-script/onendwebbtc.js +++ b/src/extension/content-script/onendwebbtc.js @@ -107,7 +107,7 @@ function postMessage(ev, response) { data: response, scope: SCOPE, }, - "*" + window.location.origin ); }