Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我创建了一个连接到本机消息传递应用程序的 chrome 扩展程序。原生消息应用程序需要知道扩展是未选中还是未加载。是否有任何事件可以让我发现扩展程序已卸载或未选中?这样我就可以将消息发送到我的本机消息应用程序以通知
fread如果在本地消息传递主机中侦听来自浏览器的消息时从 STDIN 读取失败(例如,不返回传入的缓冲区长度),则可以简单地检测到这一点。Google Chrome 在卸载扩展程序时会断开 STDIN。
fread