Files
firefox/toolkit/components/extensions/test/xpcshell/data/file_document_open.html
T
Kris Maglione 9f08d0bb02 Bug 1356273: Part 2 - Add tests that document.open()/write() only loads content scripts once. r=aswan
The combination of "match_about_blank": true and "run_at": "document_start"
can potentially cause content scripts to run twice for the same document, once
for the intermediate about:blank document created by the document.open() call,
and again for the same document with its final URL after it's been fully
setup.

This test ensures that that behavior doesn't regress.

MozReview-Commit-ID: 9XSfW3rEL4f
2017-08-03 15:21:22 -07:00

22 lines
410 B
HTML

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<iframe id="iframe"></iframe>
<script type="text/javascript">
"use strict";
addEventListener("load", () => {
let iframe = document.getElementById("iframe");
let doc = iframe.contentDocument;
doc.open("text/html");
doc.write("Hello.");
doc.close();
}, {once: true});
</script>
</body>
</html>