Skip to content Skip to sidebar Skip to footer

Can Tampermonkey Userscript Access Chrome Api?

I am developing a userscript that requiers chrome object, but I can't access it. How to access to chrome object inside tampermonkey's userscript? Maybe, some permissions in manifes

Solution 1:

Refer to Chrome extension code vs Content scripts vs Injected scripts.

Chrome extensions can access Chrome APIs and Tampermonkey is an extension. However, Tampermonkey must make a given API's functionality to a userscript via GM_ functions.

If there is not a GM_ function for what you want, then you must find another way or write a Chrome extension instead of a Tampermonkey script.

Post a Comment for "Can Tampermonkey Userscript Access Chrome Api?"