You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li><ahref="#should-block-sink-type-mismatch"><spanclass="secno">4.5.2</span><spanclass="content"><span>Should sink type mismatch violation be blocked by Content Security Policy?</span></span></a>
1571
1571
<li><ahref="#should-block-create-policy"><spanclass="secno">4.5.3</span><spanclass="content"><span>Should Trusted Type policy creation be blocked by Content Security Policy?</span></span></a>
<li><ahref="#csp-trusted-script-eval"><spanclass="secno">4.5.5.1</span><spanclass="content">'trusted-script' support for eval</span></a>
1577
+
<li><ahref="#csp-trusted-script-javascript-url"><spanclass="secno">4.5.5.2</span><spanclass="content">'trusted-script' support for javascript: URLs</span></a>
<h5class="heading settled" data-level="4.5.5.1" id="csp-trusted-script-eval"><spanclass="secno">4.5.5.1. </span><spanclass="content">'trusted-script' support for eval</span><aclass="self-link" href="#csp-trusted-script-eval"></a></h5>
2798
2804
<p>This document modifies the <ahref="https://www.w3.org/TR/CSP3/#can-compile-strings">EnsureCSPDoesNotBlockStringCompilation</a> which is reproduced in its entirety below with additions and deletions.</p>
2799
2805
<p>
2800
2806
Given two <ahref="https://tc39.github.io/ecma262/#realm">realms</a> (<var>callerRealm</var> and <var>calleeRealm</var>), and a
<pclass="note" role="note"><span>Note:</span> The previous algorithm reports violations via both report-uris where
2898
2904
callerRealm != calleeRealm. If <adata-link-type="abstract-op" href="#abstract-opdef-get-trusted-type-compliant-string" id="ref-for-abstract-opdef-get-trusted-type-compliant-string⑧">Get Trusted Type compliant string</a> reports an
2899
2905
error, it only reports it via its <var>calleeRealm</var>’s report-uri.</p>
2906
+
<h5class="heading settled" data-level="4.5.5.2" id="csp-trusted-script-javascript-url"><spanclass="secno">4.5.5.2. </span><spanclass="content">'trusted-script' support for javascript: URLs</span><aclass="self-link" href="#csp-trusted-script-javascript-url"></a></h5>
2907
+
<p>This document modifies the <ahref="https://www.w3.org/TR/CSP3/#match-element-to-source-list">Does element match source list for type and source?</a> algorithm, for it to recognize the 'trusted-script' keyword for <code>javascript:</code> navigations.</p>
2908
+
<p>Add the following step after step 1:</p>
2909
+
<olstart="2">
2910
+
<lidata-md>
2911
+
<p>If <var>type</var> is <code>"navigation"</code>, <var>list</var><adata-link-type="dfn" href="https://infra.spec.whatwg.org/#list-contain" id="ref-for-list-contain①">contains</a> an <adata-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive②">ASCII case-insensitive</a> match for the string "<adata-link-type="grammar" href="#grammardef-trusted-script" id="ref-for-grammardef-trusted-script①"><code>'trusted-script'</code></a>" and <adata-link-type="abstract-op" href="#abstract-opdef-issourceexempt" id="ref-for-abstract-opdef-issourceexempt①">IsSourceExempt</a> algorithm executed on <adata-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document">active document</a>'s <adata-link-type="dfn" href="https://html.spec.whatwg.org/multipage/dom.html#concept-document-csp-list" id="ref-for-concept-document-csp-list③">CSP list</a> returns true,
<li><ahref="#ref-for-abstract-opdef-get-trusted-type-compliant-string⑥">4.5.5.1. 'trusted-script' support for eval</a><ahref="#ref-for-abstract-opdef-get-trusted-type-compliant-string⑦">(2)</a><ahref="#ref-for-abstract-opdef-get-trusted-type-compliant-string⑧">(3)</a>
#### 'trusted-script' support for eval #### {#csp-trusted-script-eval}
1347
+
1346
1348
This document modifies the [[CSP3#can-compile-strings|EnsureCSPDoesNotBlockStringCompilation]]
1347
1349
which is reproduced in its entirety below with additions and deletions.
1348
1350
@@ -1425,6 +1427,17 @@ Note: The previous algorithm reports violations via both report-uris where
1425
1427
callerRealm != calleeRealm. If [$Get Trusted Type compliant string$] reports an
1426
1428
error, it only reports it via its |calleeRealm|'s report-uri.
1427
1429
1430
+
#### 'trusted-script' support for javascript: URLs #### {#csp-trusted-script-javascript-url}
1431
+
1432
+
This document modifies the [[CSP3#match-element-to-source-list|Does element match source list for type and source?]]
1433
+
algorithm, for it to recognize the 'trusted-script' keyword for `javascript:` navigations.
1434
+
1435
+
Add the following step after step 1:
1436
+
1437
+
2. If |type| is `"navigation"`, |list| [=list/contains=] an [=ASCII case-insensitive=]
1438
+
match for the string "<a grammar>`'trusted-script'`</a>" and [$IsSourceExempt$] algorithm executed on [=active document=]'s <a>CSP list</a> returns true,
0 commit comments