blob: e46375159fe77c66773315a21f28f93b6c6c2ce4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
/* eslint-env mozilla/chrome-script */
// Just receive 'foo' message and forward it back
// as 'bar' message
addMessageListener("foo", function(message) {
sendAsyncMessage("bar", message);
});
addMessageListener("valid-assert", function(message) {
assert.ok(true, "valid assertion");
assert.equal(1, 1, "another valid assertion");
sendAsyncMessage("valid-assert-done");
});
addMessageListener("sync-message", () => {
return "Received a synchronous message.";
});
|