<pre id="test">
<script class="testbody" type="application/javascript">
/** Test for Bug 387706 **/
SimpleTest.waitForExplicitFinish();
var finished = false;
function finish()
{
if (!finished)
{
finished = true;
SimpleTest.finish();
}
}
/** Receives MessageEvents to this window. */
function messageReceiver(evt)
{
ok(evt instanceof MessageEvent, "umm, how did we get this?");
is(evt.type, "message", "expected events of type 'message'");
is(evt.lastEventId, "", "postMessage creates events with empty lastEventId");
switch (evt.data)
{
case "path-is-set":
chromePathIsSet(evt);
break;
case "post-to-self":
checkSelf(evt);
break;
case "post-to-content-response":
receiveContent(evt);
break;
function checkSelf(evt)
{ var prepath = getChromePrePath(window.location.href);
is(evt.isTrusted, true, "should have sent a trusted event");
is(evt.origin, prepath, "wrong origin for chrome: URL");
is(evt.source, null, "chrome posters get a null source, for security");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.