We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b29a885 commit 359bb97Copy full SHA for 359bb97
.changeset/fluffy-beans-cry.md
@@ -0,0 +1,5 @@
1
+---
2
+'gitbook': patch
3
4
+
5
+Fix opening external links when the GitBook page is embedded in an iframe
packages/gitbook/src/components/primitives/Link.tsx
@@ -47,6 +47,13 @@ export const Link = React.forwardRef(function Link(
47
});
48
}
49
50
+ // When the page is embedded in an iframe, for security reasons other urls cannot be opened.
51
+ // In this case, we open the link in a new tab.
52
+ if (isExternal && window.self !== window.top) {
53
+ event.preventDefault();
54
+ window.open(href, '_blank');
55
+ }
56
57
domProps.onClick?.(event);
58
};
59
0 commit comments