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

Function initLinkEvent

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

Source from the content-addressed store, hash-verified

280}
281
282function initLinkEvent() {
283 document.documentElement.addEventListener('click', (evt) => {
284 const target = evt.target as HTMLElement
285 const link = target.closest('a[href]') as HTMLAnchorElement
286 if (!link) return
287 const sameSite = link.origin === location.origin
288 sendEvent({
289 type: EventType.link,
290 link_url: link.href,
291 link_samesite: sameSite,
292 })
293 })
294}
295
296function initHoverEvent() {
297 document.documentElement.addEventListener('mouseover', (evt) => {

Callers 1

initializeEventsFunction · 0.85

Calls 1

sendEventFunction · 0.85

Tested by

no test coverage detected