summaryrefslogtreecommitdiffstats
path: root/dom/security/test/csp/file_ignore_unsafe_inline.html
blob: b0d44b57095f395483da8934206f9db6ff3d0015 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!DOCTYPE HTML>
<html>
<head>
<title>Bug 1004703 - ignore 'unsafe-inline' if nonce- or hash-source specified</title>
</head>
<body>
<div id="testdiv">a</div>

<!-- first script whitelisted by 'unsafe-inline' -->
<script type="application/javascript">
document.getElementById('testdiv').innerHTML += 'b';
</script>

<!-- second script whitelisted by hash -->
<!-- sha256-uJXAPKP5NZxnVMZMUkDofh6a9P3UMRc1CRTevVPS/rI= -->
<script type="application/javascript">
document.getElementById('testdiv').innerHTML += 'c';
</script>

<!-- thrid script whitelisted by nonce -->
<script type="application/javascript" nonce="FooNonce">
document.getElementById('testdiv').innerHTML += 'd';
</script>

</body>
</html>