diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /browser/components/sessionstore/test/browser_461743_sample.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'browser/components/sessionstore/test/browser_461743_sample.html')
-rw-r--r-- | browser/components/sessionstore/test/browser_461743_sample.html | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/browser/components/sessionstore/test/browser_461743_sample.html b/browser/components/sessionstore/test/browser_461743_sample.html new file mode 100644 index 000000000..80c9e612a --- /dev/null +++ b/browser/components/sessionstore/test/browser_461743_sample.html @@ -0,0 +1,56 @@ +<!-- Testcase originally by <moz_bug_r_a4@yahoo.com> --> + +<!DOCTYPE html> +<title>Test for bug 461743</title> + +<body> +<iframe src="data:text/html;charset=utf-8,empty"></iframe> +<iframe></iframe> + +<script type="application/javascript"> + var chromeUrl = "chrome://global/content/mozilla.xhtml"; + var exploitUrl = "javascript:try { document.body.innerHTML = Components.utils.reportError; } catch (ex) { }"; + + var loadCount = 0; + frames[0].addEventListener("DOMContentLoaded", handleLoad, false); + frames[1].addEventListener("DOMContentLoaded", handleLoad, false); + function handleLoad() { + if (++loadCount < 2) + return; + frames[0].removeEventListener("DOMContentLoaded", handleLoad, false); + frames[1].removeEventListener("DOMContentLoaded", handleLoad, false); + + var flip = 0; + MutationEvent.prototype.toString = function() { + return flip++ == 0 ? chromeUrl : exploitUrl; + }; + + var href = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(frames[1].location), "href").get; + var loadChrome = { handleEvent: href }; + var loadExploit = { handleEvent: href }; + + function delay() { + var xhr = new XMLHttpRequest(); + xhr.open("GET", location.href, false); + xhr.send(null); + } + function done() { + var event = new MessageEvent('461743', { bubbles: true, cancelable: false, + data: "done", origin: location.href, + source: window }); + document.dispatchEvent(event); + frames[0].document.removeEventListener("DOMNodeInserted", loadChrome, true); + frames[0].document.removeEventListener("DOMNodeInserted", delay, true); + frames[0].document.removeEventListener("DOMNodeInserted", loadExploit, true); + frames[0].document.removeEventListener("DOMNodeInserted", done, true); + } + + frames[0].document.addEventListener("DOMNodeInserted", loadChrome, true); + frames[0].document.addEventListener("DOMNodeInserted", delay, true); + frames[0].document.addEventListener("DOMNodeInserted", loadExploit, true); + frames[0].document.addEventListener("DOMNodeInserted", done, true); + + frames[0].document.designMode = "on"; + }; +</script> +</body> |