Confirmed users
512
edits
mNo edit summary |
mNo edit summary |
||
| Line 16: | Line 16: | ||
In the chrome process: | In the chrome process: | ||
function onReady(callbackObj) { | function onReady(callbackObj) { | ||
associateCallbackWithDOMDocumentLoaded(callbackObj.callback); | associateCallbackWithDOMDocumentLoaded(callbackObj.callback); | ||
| Line 41: | Line 40: | ||
let child = getCPOW(m.target); | let child = getCPOW(m.target); | ||
JetpackEnv.Tabs.onReady(child.jetpack.Tabs.params[m.json.callback]); | JetpackEnv.Tabs.onReady(child.jetpack.Tabs.params[m.json.callback]); | ||
} | }); | ||
Tabs = { | Tabs = { | ||
| Line 51: | Line 50: | ||
In either instance, the chrome process will end up calling the CPOW callback using a CPOW document object (assuming content processes exist). | In either instance, the chrome process will end up calling the CPOW callback using a CPOW document object (assuming content processes exist). | ||
Note that the solutions as described are currently un-implementable, because there's no way to pass the document object to the CPOW callback as a parameter. We need chrome->jetpack CPOWs for that to work, and they don't exist yet. | Note that the solutions as described are currently un-implementable, because there's no way to pass the document object to the CPOW callback as a parameter. We need chrome -> jetpack CPOWs for that to work, and they don't exist yet. | ||
The upside is that jQuery should Just Work as soon as the chrome -> jetpack CPOWs do exist. | The upside is that jQuery should Just Work as soon as the chrome -> jetpack CPOWs do exist. | ||
Please note that the above code is very much simplified from the actual implementation. One complication is that < | Please note that the above code is very much simplified from the actual implementation. One complication is that <b>sendAsyncMessage</b> is not accessible at document level. Instead, you need code like the following to implement proxying: | ||
From a script loaded into the remote jetpack process via loadFrameScript: | From a script loaded into the remote jetpack process via loadFrameScript: | ||