https://github.com/web-platform-tests/wpt
Raw File
Tip revision: e940b3ad8382b2a2d7f0faeb0385ed53eb15283b authored by Frédéric Wang on 11 September 2018, 08:14:16 UTC
Use document.scrollingElement to access scroll properties of the viewport
Tip revision: e940b3a
report-uri-from-child-frame.html
<!DOCTYPE html>
<html>
<head>
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <title>Reporting works in child iframes.</title>
    <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'nonce-abc'">
</head>
<body>
    <script nonce="abc">
      var t1 = async_test("Check that we received a message from the child frame");

      window.onmessage = function(e) {
        if (e.data == 'cookie set') {
          var s = document.createElement('script');
          s.async = true;
          s.defer = true;
          s.src = '../support/checkReport.sub.js?reportField=violated-directive&reportValue=script-src%20%27self%27%20%27nonce-abc%27&reportCookieName=generate-csp-report';
          document.body.appendChild(s);

          t1.done();
        }
      }
    </script>
    <iframe src="support/generate-csp-report.html"/>
</body>
</html>
back to top