3

Q: Can my Tampermonkey script (or other userscript) call my Chrome extension?

I use Tampermonkey to automate routine tasks in web sites. However, some Chrome APIs (e.g., bookmarks, fileSystem) can only be accessed from a custom Chrome extension.

Tampermonkey does not provide direct access to the Chrome API, so I am looking for a workaround. My idea was to make a simple Chrome extension that does those things, and call it from my Tampermonkey script, which would still still contain the rest of the logic.

Ideas
(Admittedly, I have not yet tried these, yet.)

Security

These scripts are not distributed publicly, and are restricted to specific sites. Thus, the risks that have led Tampermonkey to not include access to those APIs are less significant in this context.

Related posts

Alex Quinn
  • 4,033
  • 3
  • 18
  • 18
  • 4
    Send a [CustomEvent](https://stackoverflow.com/a/19312198) to which your extension's content script will listen. – wOxxOm Sep 09 '20 at 15:15

0 Answers0