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 a0d1b3e commit fd1e207Copy full SHA for fd1e207
code/core/src/components/components/syntaxhighlighter/syntaxhighlighter.tsx
@@ -59,8 +59,9 @@ const themedSyntax = memoize(2)((theme) =>
59
const copyToClipboard: (text: string) => Promise<void> = createCopyToClipboardFunction();
60
61
export function createCopyToClipboardFunction() {
62
- if (navigator?.clipboard) {
63
- return (text: string) => navigator.clipboard.writeText(text);
+ if (globalWindow.top?.navigator?.clipboard) {
+ const clipboard = globalWindow.top.navigator.clipboard;
64
+ return async (text: string) => clipboard.writeText(text);
65
}
66
return async (text: string) => {
67
const tmp = document.createElement('TEXTAREA') as HTMLTextAreaElement;
0 commit comments