Does retool modify the chrome object? Cannot access chrome.runtime

  • Goal: I'd like to use chrome.runtime.sendMessage to communicate with my chrome extension's sidebar.

  • Steps: I have attempted to use chrome.runtime (our retool url is in the externally_connectable.matches array in the manifest)

  • Details: according to chrome's documentation, you need to use chrome.runtime.sendMessage from websites listed in the externally_connectable.matches array externally_connectable  |  Chrome Extensions  |  Chrome for Developers

  • Screenshots:

I've attempted just console.logging the chrome object and it does exist, but there's no runtime functionality so I can't send messages from it. We're currently using custom web events that are intercepted by our background script and then sent forward to the sidepanel but this requires a few permissions that can increase review time

Hey Shawn!

For security reasons, all JavaScript runs in a sandbox. Retool executes all JavaScript in a separate <iframe> on a different domain to prevent cross-site scripting (XSS) attacks. My understanding of Chrome's API is that you can not access these functions if the application is within an iframe. Happy to put in a feature request for this one to make the option available in the future. Hope this helps!

Hey Kenny, thanks for the reply. That would be super helpful.