fix(UMD): delay init
This commit is contained in:
@@ -20,6 +20,9 @@ const DEMO_MODEL = 'PAGE-AGENT-FREE-TESTING-RANDOM'
|
|||||||
const DEMO_BASE_URL = 'https://hwcxiuzfylggtcktqgij.supabase.co/functions/v1/llm-testing-proxy'
|
const DEMO_BASE_URL = 'https://hwcxiuzfylggtcktqgij.supabase.co/functions/v1/llm-testing-proxy'
|
||||||
const DEMO_API_KEY = 'PAGE-AGENT-FREE-TESTING-RANDOM'
|
const DEMO_API_KEY = 'PAGE-AGENT-FREE-TESTING-RANDOM'
|
||||||
|
|
||||||
|
// in case document.x is not ready yet
|
||||||
|
// @todo give a switch to disable auto-init
|
||||||
|
setTimeout(() => {
|
||||||
const currentScript = document.currentScript as HTMLScriptElement | null
|
const currentScript = document.currentScript as HTMLScriptElement | null
|
||||||
if (currentScript) {
|
if (currentScript) {
|
||||||
console.log('🚀 page-agent.js detected current script:', currentScript.src)
|
console.log('🚀 page-agent.js detected current script:', currentScript.src)
|
||||||
@@ -38,3 +41,4 @@ if (currentScript) {
|
|||||||
console.log('🚀 page-agent.js initialized with config:', window.pageAgent.config)
|
console.log('🚀 page-agent.js initialized with config:', window.pageAgent.config)
|
||||||
|
|
||||||
window.pageAgent.panel.show() // Show panel
|
window.pageAgent.panel.show() // Show panel
|
||||||
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user