MCPcopy Index your code
hub / github.com/github/docs / initHoverEvent

Function initHoverEvent

components/lib/events.ts:296–310  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

294}
295
296function initHoverEvent() {
297 document.documentElement.addEventListener('mouseover', (evt) => {
298 const target = evt.target as HTMLElement
299 const link = target.closest('a[href]') as HTMLAnchorElement
300 if (!link) return
301 if (hoveredUrls.has(link.href)) return // Otherwise this is a flood of events
302 const sameSite = link.origin === location.origin
303 hoveredUrls.add(link.href)
304 sendEvent({
305 type: EventType.hover,
306 hover_url: link.href,
307 hover_samesite: sameSite,
308 })
309 })
310}
311
312function initPrintEvent() {
313 window.addEventListener('beforeprint', () => {

Callers 1

initializeEventsFunction · 0.85

Calls 1

sendEventFunction · 0.85

Tested by

no test coverage detected