开发者

How to determine the existence of another Chrome(ium) extension?

开发者 https://www.devze.com 2023-02-13 11:21 出处:网络
Does anybody know of a reliable way to work out if a particular chrome extension is enabled or not? The docs suggest that \'chrome.extension.sendRequest\' calls the callback function if an error occu

Does anybody know of a reliable way to work out if a particular chrome extension is enabled or not?

The docs suggest that 'chrome.extension.sendRequest' calls the callback function if an error occurs, but this doesn't seem to be the case if the exten开发者_如何学Gosion itself doesn't exist.

I've also tried opening a connection to the extension and using the onDisconnect handler to register if the extension doesn't exist. This does seem to work, but I'm at a loss as to how to do one thing if the disconnect handler is called, or another thing if it isn't.

Any suggestions would be much appreciated.


You can check it with chrome.management.* API.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号