diff --git a/.changeset/gentle-frames-answer.md b/.changeset/gentle-frames-answer.md new file mode 100644 index 000000000..4c31b1dc4 --- /dev/null +++ b/.changeset/gentle-frames-answer.md @@ -0,0 +1,7 @@ +--- +"@frontify/app-bridge-app": patch +--- + +fix: send the connection handshake to the embedding window instead of the top window + +Apps now connect when the platform hosting them is itself embedded in an iframe, such as the asset chooser inside another page. The handshake also no longer reaches the top-level page. diff --git a/packages/app-bridge-app/src/utilities/notify.ts b/packages/app-bridge-app/src/utilities/notify.ts index 796ce170f..d9ec0fed9 100644 --- a/packages/app-bridge-app/src/utilities/notify.ts +++ b/packages/app-bridge-app/src/utilities/notify.ts @@ -3,7 +3,7 @@ import { type NotifyData, type NotifyOptions } from '../types/Notify.ts'; export function notify(topic: string, token: string, data?: NotifyData, options?: NotifyOptions): void { - const parentWindow = window.top; + const parentWindow = window.parent; parentWindow?.postMessage( { topic,