1 dump("Loading remote script!\n");
4 var cpm = Components.classes["@mozilla.org/childprocessmessagemanager;1"]
5 .getService(Components.interfaces.nsISyncMessageSender);
6 cpm.addMessageListener("cpm-async",
8 cpm.sendSyncMessage("ppm-sync");
9 dump(content.document.documentElement);
10 cpm.sendAsyncMessage("ppm-async");
13 var Cc = Components.classes;
14 var Ci = Components.interfaces;
15 var dshell = content.QueryInterface(Ci.nsIInterfaceRequestor)
16 .getInterface(Ci.nsIWebNavigation)
17 .QueryInterface(Ci.nsIDocShellTreeItem)
19 .QueryInterface(Ci.nsIDocShell);
22 addEventListener("click",
24 dump(e.target + "\n");
25 if (e.target instanceof Components.interfaces.nsIDOMHTMLAnchorElement &&
27 var retval = sendSyncMessage("linkclick", { href: e.target.href });
28 dump(uneval(retval[0]) + "\n");
29 // Test here also that both retvals are the same
30 sendAsyncMessage("linkclick-reply-object", uneval(retval[0]) == uneval(retval[1]) ? retval[0] : "");
35 addMessageListener("chrome-message",
37 dump(uneval(m.json) + "\n");
38 sendAsyncMessage("chrome-message-reply", m.json);
41 addMessageListener("speed-test-start",
43 while (sendSyncMessage("speed-test")[0].message != "done");
46 addMessageListener("async-echo", function(m) {
47 sendAsyncMessage(m.name);