Helping users install the AiBrow extension
Detection & installation from a webpage
async function checkInstalled () {
if (!window.aibrow) {
// The extension is not installed
console.log(`Install the extension from https://aibrow.ai/install?redirect_to=${window.location.href}`)
return false
}
const capabilities = await window.aibrow.capabilities()
if (!capabilities.helper) {
// The helper binary is not installed. We can fetch the direct link to the latest
// version for the current platform
const helperUrl = await window.aibrow.getHelperDownloadUrl()
console.log(`Install the helper from ${helperUrl} or https://aibrow.ai/install?redirect_to=${window.location.href}`)
return false
}
// We're all installed
return true
}
checkInstalled()Detection & installation from an extension
Detect if AiBrow is polyfilling browser AI APIs
Last updated