()
| 13 | |
| 14 | // Function to add copy functionality to Gemini math formulas |
| 15 | function enableGeminiMathCopy() { |
| 16 | // Find all Gemini math elements on the page (both inline and block) |
| 17 | const mathElements = document.querySelectorAll('.math-inline, .math-block'); |
| 18 | |
| 19 | mathElements.forEach(element => { |
| 20 | // Make sure we haven't already processed this element |
| 21 | if (element.dataset.geminiMathCopyEnabled) return; |
| 22 | |
| 23 | // Mark as processed |
| 24 | element.dataset.geminiMathCopyEnabled = 'true'; |
| 25 | |
| 26 | // We no longer bind events here! They are handled globally via window capture |
| 27 | // to bypass document-level interception from other extensions like gemini-voyager. |
| 28 | |
| 29 | // Add cursor pointer style to indicate clickability |
| 30 | updateElementStyle(element); |
| 31 | }); |
| 32 | } |
| 33 | |
| 34 | // 集中处理点击事件的函数 |
| 35 | async function handleGeminiMathClick(e) { |
no test coverage detected