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 扩展,它将下面的代码注入到打开的页面:
s = document.createElement "script" s.src = "//example.com/my.js" (document.head or document.documentElement).appendChild s
所以它可以加载我的javascript并在页面中运行它。但是在 my.js 完成它的工作之后,我如何向我的扩展发送消息?
谢谢!
啊,我想我找到了答案: http ://code.google.com/chrome/extensions/content_scripts.html#host-page-communication