Bilibili-Evolved/src/activity/disable-profile-popup.ts
2020-05-15 10:51:30 +08:00

24 lines
628 B
TypeScript

let eventAttached = false
export const disableProfilePopup = () => {
if (document.URL.replace(location.search, '') === 'https://t.bilibili.com/') {
if (eventAttached) {
return
}
(async () => {
const list = await SpinQuery.select('.live-up-list') as HTMLElement
if (list !== null) {
list.addEventListener('mouseenter', e => {
if (settings.fixedSidebars || settings.extendFeedsLive) {
e.stopImmediatePropagation()
}
}, { capture: true })
eventAttached = true
}
})()
}
}
export default {
export: {
disableProfilePopup,
},
}