0

I would like to send a value from the tab html content to my chrome extension background script.

Right now I'm using a workaround, that is

chrome.tabs.executeScript() to send a code to retrieve data and then send it to my web server via Ajax, and then my background script checks to see if its there in my server. But that's obviously not the right way.

Is there a way to get element values and then send it back to the background script? so I can keep working with the value?

Thanks!

4

1 回答 1

1

chrome.extension.sendRequest()有对应的chrome.extension.onRequest.addListener()

如果不是很明显,您可以在此处阅读有关消息传递的所有信息: http ://code.google.com/chrome/extensions/messaging.html

于 2012-06-08T00:21:26.490 回答