From 7e7b36bfa187ecad261c9e6a9f5317cbd0b1ad52 Mon Sep 17 00:00:00 2001 From: Hsiao-Ting Date: Sun, 2 Feb 2025 23:02:06 +0800 Subject: [PATCH] fix: fix `javascript:` URL issue on React 19 --- src/common/components/Token.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common/components/Token.tsx b/src/common/components/Token.tsx index 5c66e64..658aebc 100644 --- a/src/common/components/Token.tsx +++ b/src/common/components/Token.tsx @@ -162,7 +162,13 @@ const User = () => {

{ + // 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)} >