You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm trying to make an extension that modifies WhatsApp, but I needed to use plasmo/vue together with the wppconnect-team/wa-js package, it basically exposes some WhatsApp functions to be used in JS, for that it would basically be just a matter of injecting the script into the page.
I have already tried injecting the script via background script and also within a CSUI:
functionloadScript(src: string): Promise<void>{returnnewPromise((resolve,reject)=>{constscript=document.createElement('script')script.type='text/javascript'script.src=srcscript.async=truescript.textContent=`console.log('script loadedd')`script.onload=(event)=>{console.log('script loaded',window)returnresolve()}script.onerror=()=>reject(newError(`Failed to load script: ${src}`))document.head.appendChild(script)})}
So when I type WPP or window.WPP in the console it gives me access to the functions. However, I cannot access these same variables within PLASMO/VUE, the window object comes without the .wpp and the WPP does not exist within the console.log that I give within plasmo/vue.
I have tried content script without vue and it still does not work, I have tried inserting it with the world: 'MAIN' parameter, but I have not been able to make it work.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, I'm trying to make an extension that modifies WhatsApp, but I needed to use plasmo/vue together with the wppconnect-team/wa-js package, it basically exposes some WhatsApp functions to be used in JS, for that it would basically be just a matter of injecting the script into the page.
I have already tried injecting the script via background script and also within a CSUI:
So when I type WPP or window.WPP in the console it gives me access to the functions. However, I cannot access these same variables within PLASMO/VUE, the window object comes without the .wpp and the WPP does not exist within the console.log that I give within plasmo/vue.
I have tried content script without vue and it still does not work, I have tried inserting it with the world: 'MAIN' parameter, but I have not been able to make it work.
Can anyone help me with this?
Beta Was this translation helpful? Give feedback.
All reactions