Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/sandboxed-iframe-javascript-url.html

Issue 2154213003: Prevent 'javascript:' URL execution in sandboxed frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="/resources/testharness.js"></script>
3 <script src="/resources/testharnessreport.js"></script>
4 <body>
5 <script>
6 async_test(t => {
7 var i = document.createElement('iframe');
8 i.setAttribute("sandbox", "allow-scripts");
9 i.setAttribute("src", "javascript:top.postMessage('fail', '*');");
10 window.addEventListener(
11 "message",
12 t.unreached_func("The sandboxed 'javascript:' URL should not execute ."));
13
14 document.body.appendChild(i);
15
16 // TODO(mkwst): I would love a better test here, but I don't know how el se to
17 // verify that the script _doesn't_ execute.
18 setTimeout(t.done.bind(t), 250);
19 }, "JavaScript URLs in sandboxed iframes should not execute, as the origin i s distinct from its opener.");
20 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698