Files
ReZygisk/webroot/js/browserRedirect.js
2024-11-12 00:09:22 -03:00

11 lines
537 B
JavaScript

import { exec } from './kernelsu.js'
document.addEventListener('click', async (event) => {
const getLink = event.target.getAttribute('credit-link')
if (!getLink || typeof getLink !== 'string') return;
const ptrace64Cmd = await exec(`am start -a android.intent.action.VIEW -d https://${getLink}`).catch(() => {
return window.open(`https://${getLink}`, "_blank", 'toolbar=0,location=0,menubar=0')
})
if (ptrace64Cmd.errno !== 0) return window.open(`https://${getLink}`, "_blank", 'toolbar=0,location=0,menubar=0')
}, false)