different WINDOW variables

I have a script that creates an object that I need to use inside the window variable. I insert this script like this:

const script = document.createElement('script')
script.type = 'text/javascript'
script.src = src
script.async = true
script.onload = () => resolve()
script.onerror = () => reject(new Error(`Failed to load script: ${src}`))
document.head.appendChild(script)


Then, inside some method or hook of vue I try to use the window.WPP object, but it doesn't exist, but if I type it in the console it does exist.
I've already tried using world: MAIN but it still doesn't work!
Was this page helpful?