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
<p>Let <var>encodedScriptSource</var> be the result of removing the leading <code>"javascript:"</code> from <var>urlString</var>.</p>
2969
2969
<lidata-md>
2970
-
<p>Let <var>defaultPolicy</var> be the result of executing <adata-link-type="abstract-op" href="#abstract-opdef-get-default-policy" id="ref-for-abstract-opdef-get-default-policy①">Get default policy</a> algorithm on <var>request</var>’s <adata-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-client" id="ref-for-concept-request-client">clients</a>'s <adata-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global">global object</a>'s <adata-link-type="dfn" href="#window-trusted-type-policy-factory" id="ref-for-window-trusted-type-policy-factory③">trusted type policy factory</a>.</p>
2971
-
<lidata-md>
2972
-
<p>If <var>defaultPolicy</var> is <code>null</code>, return <code>"Blocked"</code> and abort further steps.</p>
2973
-
<lidata-md>
2974
-
<p>Let <var>convertedScriptSource</var> be the result of executing <adata-link-type="abstract-op" href="#abstract-opdef-create-a-trusted-type" id="ref-for-abstract-opdef-create-a-trusted-type④">Create a Trusted Type</a> algorithm, with the following arguments:</p>
2970
+
<p>Let <var>convertedScriptSource</var> be the result of executing <adata-link-type="abstract-op" href="#abstract-opdef-process-value-with-a-default-policy" id="ref-for-abstract-opdef-process-value-with-a-default-policy①">Process value with a default policy</a> algorithm, with the following arguments:</p>
2975
2971
<ul>
2976
2972
<lidata-md>
2977
-
<p><var>defaultPolicy</var> as <var>policy</var></p>
2973
+
<p><codeclass="idl"><adata-link-type="idl" href="#trustedscript" id="ref-for-trustedscript①①">TrustedScript</a></code> as <var>expectedType</var></p>
<p><code>"TrustedScript</code> as <var>trustedTypeName</var></p>
2977
+
<p><var>encodedScriptSource</var> as <var>input</var></p>
2982
2978
<lidata-md>
2983
-
<p>« <code>"Location.href"</code>» as <var>arguments</var></p>
2979
+
<p><code>"Location.href"</code> as <var>sink</var></p>
2984
2980
</ul>
2985
-
<lidata-md>
2986
-
<p>If <var>convertedScriptSource</var> is not a <codeclass="idl"><adata-link-type="idl" href="#trustedscript" id="ref-for-trustedscript①①">TrustedScript</a></code> object, return <code>"Blocked"</code> and abort further steps.</p>
2981
+
<p>If that algorithm threw an error or <var>convertedScriptSource</var> is not a <codeclass="idl"><adata-link-type="idl" href="#trustedscript" id="ref-for-trustedscript①②">TrustedScript</a></code> object, return "Blocked" and abort further steps.</p>
2987
2982
<lidata-md>
2988
2983
<p>Set <var>urlString</var> to be the result of prepending <code>"javascript:"</code> to stringified <var>convertedScriptSource</var>.</p>
Copy file name to clipboardExpand all lines: spec/index.bs
+8-9Lines changed: 8 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1513,15 +1513,14 @@ Note: This algorithm assures that the code to be executed by a navigation to a `
1513
1513
1. If |request|'s [=request/url=]'s [=url/scheme=] is not `"javascript"`, return `"Allowed"` and abort further steps.
1514
1514
1. Let |urlString| be the result of running the [=URL serializer=] on |request|'s [=request/url=].
1515
1515
1. Let |encodedScriptSource| be the result of removing the leading `"javascript:"` from |urlString|.
1516
-
1. Let |defaultPolicy| be the result of executing [$Get default policy$] algorithm on |request|'s [=request/clients=]'s [=environment settings object/global object=]'s [=trusted type policy factory=].
1517
-
1. If |defaultPolicy| is `null`, return `"Blocked"` and abort further steps.
1518
-
1. Let |convertedScriptSource| be the result of executing [$Create a Trusted Type$] algorithm, with the following arguments:
1519
-
1520
-
* |defaultPolicy| as |policy|
1521
-
* |encodedScriptSource| as |value|
1522
-
* `"TrustedScript` as |trustedTypeName|
1523
-
* « `"Location.href"` » as |arguments|
1524
-
1. If |convertedScriptSource| is not a {{TrustedScript}} object, return `"Blocked"` and abort further steps.
1516
+
1. Let |convertedScriptSource| be the result of executing [$Process value with a default policy$] algorithm, with the following arguments:
1517
+
1518
+
* {{TrustedScript}} as |expectedType|
1519
+
* |request|'s [=request/clients=]'s [=environment settings object/global object=] as |global|
1520
+
* |encodedScriptSource| as |input|
1521
+
* `"Location.href"` as |sink|
1522
+
1523
+
If that algorithm threw an error or |convertedScriptSource| is not a {{TrustedScript}} object, return "Blocked" and abort further steps.
1525
1524
1. Set |urlString| to be the result of prepending `"javascript:"` to stringified |convertedScriptSource|.
1526
1525
1. Let |newURL| be the result of running the [=URL parser=] on |urlString|. If the parser returns a failure, return `"Blocked"` and abort further steps.
0 commit comments