content/base/test/file_bug426646-1.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <html><head>
     2 <title>Bug 426646, Using location.replace breaks iframe history</title>
     3 <script type="text/javascript">
     4 var url1 = "data:text/html;charset=utf-8,1st%20page";
     6 function soon(f) {
     7   return function() { setTimeout(f, 0); };
     8 }
    10 function doe() {
    11   document.body.innerHTML = "<iframe src='about:blank'></iframe>";
    12   document.body.innerHTML += "<iframe src='about:blank'></iframe>";
    13   window.frames[0].frameElement.onload = soon(doe2);
    14   window.frames[0].location.replace(url1);
    15 }
    17 function doe2() {
    18   window.frames[0].location = 'data:text/html;charset=utf-8,2nd%20page';
    19   window.frames[0].frameElement.onload = soon(doe3);
    20 }
    22 function doe3() {
    23   window.frames[0].frameElement.onload = soon(doe4);
    24   history.go(-1);
    25 }
    27 function doe4() {
    28   opener.is(window.frames[0].location, url1, "History.go(-1) didn't work?");
    29   opener.is(window.frames[1].location, "about:blank",
    30             "History.go(-1) didn't work?");
    31   close();
    32 }
    33 </script>
    34 </head>
    35 <body onload="doe();" onunload="opener.nextTest();">
    36 </body></html>

mercurial