Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <html><head> |
michael@0 | 2 | <title>Bug 426646, Using location.replace breaks iframe history</title> |
michael@0 | 3 | <script type="text/javascript"> |
michael@0 | 4 | var url1 = "data:text/html;charset=utf-8,1st%20page"; |
michael@0 | 5 | |
michael@0 | 6 | function soon(f) { |
michael@0 | 7 | return function() { setTimeout(f, 0); }; |
michael@0 | 8 | } |
michael@0 | 9 | |
michael@0 | 10 | function doe() { |
michael@0 | 11 | document.body.innerHTML = "<iframe src='about:blank'></iframe>"; |
michael@0 | 12 | document.body.innerHTML += "<iframe src='about:blank'></iframe>"; |
michael@0 | 13 | window.frames[0].frameElement.onload = soon(doe2); |
michael@0 | 14 | window.frames[0].location.replace(url1); |
michael@0 | 15 | } |
michael@0 | 16 | |
michael@0 | 17 | function doe2() { |
michael@0 | 18 | window.frames[0].location = 'data:text/html;charset=utf-8,2nd%20page'; |
michael@0 | 19 | window.frames[0].frameElement.onload = soon(doe3); |
michael@0 | 20 | } |
michael@0 | 21 | |
michael@0 | 22 | function doe3() { |
michael@0 | 23 | window.frames[0].frameElement.onload = soon(doe4); |
michael@0 | 24 | history.go(-1); |
michael@0 | 25 | } |
michael@0 | 26 | |
michael@0 | 27 | function doe4() { |
michael@0 | 28 | opener.is(window.frames[0].location, url1, "History.go(-1) didn't work?"); |
michael@0 | 29 | opener.is(window.frames[1].location, "about:blank", |
michael@0 | 30 | "History.go(-1) didn't work?"); |
michael@0 | 31 | close(); |
michael@0 | 32 | } |
michael@0 | 33 | </script> |
michael@0 | 34 | </head> |
michael@0 | 35 | <body onload="doe();" onunload="opener.nextTest();"> |
michael@0 | 36 | </body></html> |