summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/content-security-policy/reporting/report-uri-from-inline-javascript.html
blob: 1cb5a2c659c9a8790df462c4a887fbf4b82d2240 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE html>
<html>
<head>
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <title>Violation report is sent from inline javascript.</title>
    <!-- CSP headers
         Content-Security-Policy: img-src 'none'; report-uri /reporting/resources/report.py?op=put&reportID={{$id}}
         -->
</head>
<body>
    <script>
        // This script block will trigger a violation report.
        var i = document.createElement('img');
        i.src = '/security/resources/abe.png';
        document.body.appendChild(i);
    </script>
    <script async defer src='../support/checkReport.sub.js?reportField=violated-directive&reportValue=img-src%20%27none%27'></script>
</body>
</html>