简体   繁体   English

后台 Js 未定义 Chrome 扩展

[英]Background Js undefined Chrome Extension

console.log(chrome.runtime.sendMessage({from:"script2",message:"hello!"}));

Mean While I am trying to send the message from background script to content script which is not working意思是当我试图将消息从后台脚本发送到不工作的内容脚本时

这是我使用的每个代码都会向我抛出错误的图片,向我抛出“未定义”消息

It may mean that it was sent successfully.这可能意味着它已成功发送。

I recommend looking at Network , then clicking on the request GET or POST and finally looking at the response.我建议查看Network ,然后单击请求GETPOST ,最后查看响应。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM