MCPcopy Create free account
hub / github.com/Yorick-Ryu/deep-share / enableGeminiMathCopy

Function enableGeminiMathCopy

scripts/copyGeminiMath.js:15–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13
14// Function to add copy functionality to Gemini math formulas
15function 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// 集中处理点击事件的函数
35async function handleGeminiMathClick(e) {

Callers 2

loadSettingsFunction · 0.85
initGeminiMathCopyFunction · 0.85

Calls 2

querySelectorAllMethod · 0.80
updateElementStyleFunction · 0.70

Tested by

no test coverage detected