AutomaApp / automa

A browser extension for automating your browser by connecting blocks
https://www.automa.site
Other
10.72k stars 1.09k forks source link

Allow Automa JavaScript Blocks To Access Chrome APIs #1715

Open scottwmaxwell opened 1 month ago

scottwmaxwell commented 1 month ago

Is your feature request related to a problem? Please describe.

More of a limitation. I'm not able to run JavaScript in the blocks if it includes calls on the Chrome APIs. For my use case, I need to call chrome.runtime.sendMessage(extendionId: string, {action: "message"});

When I attempt to do this using the JavaScript block, It produces the following message: Cannot read properties of undefined (reading 'sendMessage')

I believe this is because the JS is running in a sandbox context, even when "background" is selected.

Describe the solution you'd like

I would like there to either be:

Describe alternatives you've considered

I would like to automate user clicks on chrome-extension:// urls, but I cannot do so because of security restrictions of Chrome extensions. Because of this, I need to create my own automations, but would like to integrate it with Automa to do some of the work. Having messaging between the Automa extension and my own extension is necessary for this.