layout/base/tests/file_bug607529.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <!DOCTYPE html>
     2 <script>
     3   window.onerror = function(msg, url, line) {
     4     var myMsg = JSON.stringify({msg: msg, url: url, line: line, error: true});
     5     opener.postMessage(myMsg, "*");
     6   }
     8   var report = false;
    10   function g() {
    11     if (report) {
    12       opener.postMessage("callbackHappened", "*");
    13     }
    14     window.mozRequestAnimationFrame(g);
    15   }
    16   g();
    18   window.onload = function() {
    19     opener.postMessage("loaded", "*");
    20   }
    22   addEventListener("pagehide", function f(e) {
    23     if (!e.persisted && !report) {
    24       opener.postMessage("notcached", "*");
    25     }
    26   }, false);
    28   addEventListener("pageshow", function f(e) {
    29     if (e.persisted) {
    30       opener.postMessage("revived", "*");
    31     }
    32   }, false);
    34   window.onmessage = function (e) {
    35     if (e.data == "report") {
    36       report = true;
    37     }
    38   };
    40 </script>

mercurial