You've already forked AstralRinth
forked from didirus/AstralRinth
* Implement ads in desktop app * Finish ads * use git dep instead * attempt to fix linux build (temp) * bump version + lint * comment more * fix build * try to fix linux build * Fix crashing on windows * Fix icons not showing * Remove useless env vars * Actual linux build fix * Run fmt * Fix scrolling * fix clippy * bump version + fix localhost * rev linux build patch * update version num * update csp * update csp * update csp * Switch to mousewheel event
18 lines
459 B
JavaScript
18 lines
459 B
JavaScript
document.addEventListener('click', function (e) {
|
|
let target = e.target
|
|
while (target != null) {
|
|
if (target.matches('a')) {
|
|
e.preventDefault()
|
|
if (target.href) {
|
|
window.top.postMessage({ modrinthOpenUrl: target.href }, 'https://modrinth.com')
|
|
}
|
|
break
|
|
}
|
|
target = target.parentElement
|
|
}
|
|
})
|
|
|
|
window.open = (url, target, features) => {
|
|
window.top.postMessage({ modrinthOpenUrl: url }, 'https://modrinth.com')
|
|
}
|