tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

MessageEvent_properties.htm (946B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4 <title> MessageEvent interface and properties </title>
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 </head>
      8 <body>
      9 <div id=log></div>
     10 
     11 <div style="display:none">
     12    <iframe width="70%" onload="do_test()" src="./support/ChildWindowPostMessage.htm"></iframe>
     13 </div>
     14 
     15 <script>
     16 async_test(function() {
     17    window.do_test = this.step_func(function() {
     18        document.querySelector("iframe").contentWindow.postMessage("foo", "*");
     19    })
     20 
     21    window.addEventListener("message", this.step_func_done(function(e) {
     22        e.preventDefault();
     23        assert_true(e instanceof MessageEvent, "Should be MessageEvent");
     24        assert_equals(e.type, "message");
     25        assert_false(e.bubbles, "bubbles");
     26        assert_false(e.cancelable, "cancelable");
     27        assert_false(e.defaultPrevented, "defaultPrevented");
     28    }), false);
     29 });
     30 </script>
     31 </body>
     32 </html>