Skip to content

Commit

Permalink
fix: fix javascript: URL issue on React 19
Browse files Browse the repository at this point in the history
  • Loading branch information
littlebtc committed Feb 2, 2025
1 parent 10a92f3 commit 7e7b36b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/common/components/Token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,13 @@ const User = () => {
<p>
<a
className="btn"
href={bookmarkletContent(token)}
ref={(node) => {
// Fix React 19 blocking `javascript:` URLs
// https://github.com/facebook/react/issues/16382#issuecomment-607252694
if (node) {
node.setAttribute("href", bookmarkletContent(token))
}
}}
onClick={async (e) => await copyBookmarklet(e, token)}
>
<MdiCloudDownloadOutline />
Expand Down

0 comments on commit 7e7b36b

Please sign in to comment.