如何确定是否存在另一个Chrome(ium)扩展? [英] How to determine the existence of another Chrome(ium) extension?
问题描述
有人知道一个可靠的方法来确定是否启用了某个特定的Chrome扩展吗?
Does anybody know of a reliable way to work out if a particular chrome extension is enabled or not?
文档建议'chrome.extension.sendRequest'调用回调函数如果发生错误,但这似乎并不是这种情况,如果扩展本身不存在。
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 extension itself doesn't exist.
我也试过打开一个连接扩展名并使用onDisconnect处理程序来注册扩展名是否不存在。这似乎工作,但我不知道如果断开处理程序被称为如何做一件事,或者如果不是另一件事,我不知道。
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.
任何建议将不胜感激。
推荐答案
您可以使用 chrome.management。*
API。
You can check it with chrome.management.*
API.
这篇关于如何确定是否存在另一个Chrome(ium)扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!