Skip to content

Commit

Permalink
Test that plugin documents are not accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic committed Aug 9, 2021
1 parent af915c5 commit 695d629
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Same-origin PDFs must not create accessible Document objects</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<!-- https://github.com/whatwg/html/pull/6947 -->

<iframe src="resources/portable-document-format-sample-valid.pdf"></iframe>

<script>
setup({ explicit_done: true });

window.onload = () => {
test(() => {
assert_throws_dom("SecurityError", () => {
document.querySelector("iframe").contentWindow.document;
});
});
done();
};
</script>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Content-Type: application/pdf

0 comments on commit 695d629

Please sign in to comment.