开发者

How can I pass a message from outside URL to my Chrome Extension?

开发者 https://www.devze.com 2023-03-17 05:21 出处:网络
I know there\'s a way for extensions and pages to communicate locally, but I need to send a message from an outside URL, have my Chrome Extension listen for it.

I know there's a way for extensions and pages to communicate locally, but I need to send a message from an outside URL, have my Chrome Extension listen for it.

I have tried easyXDM in the background page, but it seems to stop listening after awhile, as if Google "turns off开发者_运维技巧" the Javascript in the background page after awhile.


I think you may try some walk around and build a site with some specific data structure, and then implement a content script which will look for this specific that specific data structure, and when i finds one it can fetch the data you want to be passed to your extension.


Yes, you need a content script that communicates with the page using DOM Events.. Instructions on how to do that are here: http://code.google.com/chrome/extensions/content_scripts.html#host-page-communication

0

精彩评论

暂无评论...
验证码 换一张
取 消