Merge branch 'main' into codespaces-universe-megabranch
This commit is contained in:
@@ -57,6 +57,7 @@ type SendEventProps = {
|
||||
exit_visit_duration?: number
|
||||
exit_scroll_length?: number
|
||||
link_url?: string
|
||||
link_samesite?: boolean
|
||||
search_query?: string
|
||||
search_context?: string
|
||||
search_result_query?: string
|
||||
@@ -255,11 +256,13 @@ function initCopyButtonEvent() {
|
||||
function initLinkEvent() {
|
||||
document.documentElement.addEventListener('click', (evt) => {
|
||||
const target = evt.target as HTMLElement
|
||||
const link = target.closest('a[href^="http"]') as HTMLAnchorElement
|
||||
const link = target.closest('a[href]') as HTMLAnchorElement
|
||||
if (!link) return
|
||||
const sameSite = link.origin === location.origin
|
||||
sendEvent({
|
||||
type: EventType.link,
|
||||
link_url: link.href,
|
||||
link_samesite: sameSite,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user