Skip to content

Commit a9a7944

Browse files
committed
Support noreferrer for window.open()
Tests: web-platform-tests/wpt#15352. Fixes #4111.
1 parent f47773d commit a9a7944

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

source

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78483,13 +78483,20 @@ dictionary <dfn>WindowPostMessageOptions</dfn> : <span>PostMessageOptions</span>
7848378483
<li><p>Let <var>tokenizedFeatures</var> be the result of <span
7848478484
data-x="concept-window-open-features-tokenize">tokenizing</span> <var>features</var>.</p></li>
7848578485

78486-
<li><p>Let <var>noopener</var> be false.</p></li>
78486+
<li><p>Let <var>noopener</var> and <var>noreferrer</var> be false.</p></li>
7848778487

7848878488
<li><p>If <var>tokenizedFeatures</var> <span data-x="map exists">contains</span> an entry with
7848978489
the key "<code data-x="">noopener</code>", then set <var>noopener</var> to the result of <span
7849078490
data-x="concept-window-open-features-parse-boolean">parsing
7849178491
<var>tokenizedFeatures["noopener"]</var> as a boolean feature</span>.</p></li>
7849278492

78493+
<li><p>If <var>tokenizedFeatures</var> <span data-x="map exists">contains</span> an entry with
78494+
the key "<code data-x="">noreferrer</code>", then set <var>noreferrer</var> to the result of
78495+
<span data-x="concept-window-open-features-parse-boolean">parsing
78496+
<var>tokenizedFeatures["noreferrer"]</var> as a boolean feature</span>.</p></li>
78497+
78498+
<li><p>If <var>noreferrer</var> is true, then set <var>noopener</var> to true.</p></li>
78499+
7849378500
<li>
7849478501
<p>Let <var>target browsing context</var> and <var>new</var> be the result of applying <span>the
7849578502
rules for choosing a browsing context</span> given <var>target</var>, <var>source browsing
@@ -78509,24 +78516,31 @@ dictionary <dfn>WindowPostMessageOptions</dfn> : <span>PostMessageOptions</span>
7850978516
<var>target browsing context</var> given <var>tokenizedFeatures</var>. <ref
7851078517
spec="CSSOMVIEW"></p></li>
7851178518

78512-
<li><p>Let <var>resource</var> be the <span>URL</span> "<code>about:blank</code>".</p></li>
78519+
<li><p>Let <var>urlRecord</var> be the <span>URL</span> "<code>about:blank</code>".</p></li>
7851378520

7851478521
<li>
7851578522
<p>If <var>url</var> is not the empty string or <var>new</var> is true, then:
7851678523

7851778524
<ol>
7851878525
<li><p>If <var>url</var> is not the empty string, then <span data-x="parse a url">parse</span>
78519-
<var>url</var> relative to <var>entry settings</var>, and set <var>resource</var> to the
78526+
<var>url</var> relative to <var>entry settings</var>, and set <var>urlRecord</var> to the
7852078527
<span>resulting URL record</span>, if any. If the <span>parse a URL</span> algorithm failed,
7852178528
then throw a <span>"<code>SyntaxError</code>"</span> <code>DOMException</code>.</p></li>
7852278529

78523-
<li><p>If <var>resource</var> is "<code>about:blank</code>" and <var>new</var> is true, then
78530+
<li><p>Let <var>request</var> be a new <span data-x="concept-request">request</span> whose
78531+
<span data-x="concept-request-url">URL</span> is <var>urlRecord</var>.</p></li>
78532+
78533+
<li><p>If <var>noreferrer</var> is true, then set <var>request</var>'s <span
78534+
data-x="concept-request-referrer">referrer</span> to "<code
78535+
data-x="">noreferrer</code>".</p></li>
78536+
78537+
<li><p>If <var>urlRecord</var> is "<code>about:blank</code>" and <var>new</var> is true, then
7852478538
<span>queue a task</span> to <span data-x="concept-event-fire">fire an event</span> named <code
7852578539
data-x="event-load">load</code> at <var>target browsing context</var>'s <code>Window</code>
7852678540
object, with the <var>legacy target override flag</var> set.</p>
7852778541

7852878542
<li><p>Otherwise, <span>navigate</span><!--DONAV window.open()--> <var>target browsing
78529-
context</var> to <var>resource</var>, with the <var><span>exceptions enabled flag</span></var>
78543+
context</var> to <var>request</var>, with the <var><span>exceptions enabled flag</span></var>
7853078544
set. If <var>new</var> is true, then <span data-x="replacement enabled">replacement must be
7853178545
enabled</span>. The <span>source browsing context</span> is <var>source browsing context</var>.
7853278546
Rethrow any exceptions.</p></li>

0 commit comments

Comments
 (0)