Chrome extension异常 chrome.runtime.sendMessage() called from a webpage must specify an Extension ID (string) for its first argument

Uncaught TypeError: Error in invocation of runtime.sendMessage(optional string extensionId, any message, optional object options, optional function callback): chrome.runtime.sendMessage() called from a webpage must specify an Extension ID (string) for its first argument.
at <anonymous>:1:16

这个异常的原因sendMessage需要等待页面加载完成,应当在页面加载完成后再行调用

posted @ 2022-12-30 00:27  崩溃大喵  阅读(692)  评论(0)    收藏  举报