Skip to content

Commit

Permalink
Firefox clipboard fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tomayac committed May 26, 2023
1 parent 297f7a2 commit 4a22344
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 10 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
}
</script>
<base target="_blank" />
<script type="module" crossorigin src="/assets/index-72d74a78.js"></script>
<script type="module" crossorigin src="/assets/index-08969439.js"></script>
<link rel="stylesheet" href="/assets/style-02ad85c7.css">
<link rel="manifest" href="/manifest.webmanifest"></head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion docs/sw.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion src/js/clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,20 @@ copyButton.addEventListener('click', async () => {
]);
// Safari (non-optimized SVG)
} else {
/*
await navigator.clipboard.write([
new ClipboardItem({
'text/plain': new Promise(async (resolve) => {
'text/plain': new Promise((resolve) => {
resolve(new Blob([svg], { type: 'text/plain' }));
}),
}),
]);
*/
await navigator.clipboard.write([
new ClipboardItem({
'text/plain': new Blob([svg], { type: 'text/plain' }),
}),
]);
}
}
// Chromium < 98.
Expand Down

0 comments on commit 4a22344

Please sign in to comment.