Basically means what it says. I believe it's called in the same context
as chrome.tabs.executeScript, but I'm not sure if that's always the
case. you can create an anonymous function (e.g.: "function() {}"), or
create one before-hand and include it in the executeScript call:
details = {code: "alert('This alert appears on the page.');
chrome.extension.sendRequest() /* port = chrome.extension.connect();
*/"}
function doSomething() {
//code to execute after alert, port creation, etc..
}
chrome.tabs.executeScript(tabId, details, doSomething);
// You should have gotten tabId previously
// I didn't show that simply for brevity.
You might be able to include a chrome.extension.connect after the code
you execute on the page (I'm not sure if pages are allowed to do that,
though) with the return value. Otherwise, if you know the tabId, you can
use chrome.tabs.connect (from the extension) or chrome.extension.connect
(from the page; you need only your extension id for this, so it may be
ideal) to communicate between the page and your extension.