Confirmed users
157
edits
No edit summary |
No edit summary |
||
| Line 15: | Line 15: | ||
- <b>sendAsyncMessage</b> sends asynchronously a message to chrome. It takes 1 or 2 parameters; first one is the name of the message and second one is a JS object which will be JSON'ed. | - <b>sendAsyncMessage</b> sends asynchronously a message to chrome. It takes 1 or 2 parameters; first one is the name of the message and second one is a JS object which will be JSON'ed. | ||
- <b>sendSyncMessage</b> sends synchronously a message to chrome. Currently it takes 1 or | - <b>sendSyncMessage</b> sends synchronously a message to chrome. Currently it takes 1 or more parameters; first one is the name of the message, second one is a JS object which will be JSON'ed and the rest are JS objects, which chrome process can access from message.objects list. If chrome process message listener returns some value, it will be JSON'ed and sendSyncMessage() returns that in an array. (In an array because chrome process may have several listeners for a message and each one may return a result.)<br> | ||
<i>NOTE!</i> In the near future sendSyncMessage() will be able to take more parameters. The parameters after 2nd one will be send as [https://bugzilla.mozilla.org/show_bug.cgi?id=516522 CPOW] objects to the chrome process. | <i>NOTE!</i> In the near future sendSyncMessage() will be able to take more parameters. The parameters after 2nd one will be send as [https://bugzilla.mozilla.org/show_bug.cgi?id=516522 CPOW] objects to the chrome process. | ||
| Line 43: | Line 43: | ||
<b>sync</b>: %true or false%, | <b>sync</b>: %true or false%, | ||
<b>json</b>: %json object or null% | <b>json</b>: %json object or null% | ||
<b>objects</b>: %an array of objects sent using sendSyncMessage% | |||
} | } | ||