I am currently in the process of developing a website named websiteA using Laravel 8 and Vuejs, along with a Chrome extension that utilizes JavaScript for web scraping. This extension is designed to extract content from another websiteB, and my goal is to store this scraped data directly into the authenticated user's row within websiteA's database. However, I have encountered an obstacle in terms of retrieving the authenticated user's email or ID from websiteA to the Chrome extension, as it needs this information to correctly save the data.
Up to this point, my attempts have involved sending a message from websiteA to the extension by specifying the extension's ID and utilizing:
chrome.runtime.sendMessage
while managing the incoming message on the extension side using
chrome.runtime.onMessageExternal.addListener
Unfortunately, I have encountered an issue where Vue does not recognize the sendMessage method, resulting in the following error being displayed:
"TypeError: Cannot read property 'sendMessage' of undefined"
Why is Vue displaying this error? Is there an alternative approach that could be more effective?
In essence, my primary objective is to successfully transmit either the user's ID or email from websiteA to the Chrome extension present on websiteB.