Skip to content

Commit 0bdb8e0

Browse files
authored
Fix an issue where certain integrations which rely on iframes could render incorrectly in the preview. (#819)
1 parent b05fd93 commit 0bdb8e0

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

.changeset/cold-tires-rule.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@gitbook/integration-marketo': patch
3+
'@gitbook/integration-mermaid': patch
4+
'@gitbook/integration-runkit': patch
5+
---
6+
7+
Fix an issue where certain integrations which rely on iframes could render incorrectly in the preview.

integrations/marketo/webframe/src/webframe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const gitbookWebFrame = window.top;
1+
const gitbookWebFrame = window.parent;
22
const params = new URLSearchParams(window.location.search);
33
const formId = params.get('formId');
44
const munchkinId = params.get('munchkinId');

integrations/mermaid/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export default createIntegration({
126126
}
127127
128128
function sendAction(action) {
129-
window.top.postMessage(
129+
window.parent.postMessage(
130130
{
131131
action,
132132
},

integrations/runkit/webframe/src/webframe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const gitbookWebFrame = window.top;
1+
const gitbookWebFrame = window.parent;
22

33
let readOnly = false;
44
let runKitNotebook: NotebookEmbed | null = null;

0 commit comments

Comments
 (0)