Skip to content

Commit

Permalink
Modify pushState()/replaceState()'s URL rewriting check
Browse files Browse the repository at this point in the history
This allows the query component to change in the cross-origin case, not just the fragment component.

This better aligns with browsers, although not exactly with any particular browser, since browsers seem to special-case opaque origins. See the full analysis at #6836 (comment).

Closes #6836.
  • Loading branch information
domenic committed Sep 1, 2021
1 parent b10b69b commit 74c6fd2
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -85094,9 +85094,8 @@ interface <dfn interface>History</dfn> {
<li>
<p>If <var>url</var>'s <span data-x="concept-url-origin">origin</span> is not <span>same
origin</span> with <var>document</var>'s <span data-x="concept-document-origin">origin</span>,
and <var>url</var> and <var>documentURL</var> differ in their <span
data-x="concept-url-path">path</span> or <span data-x="concept-url-query">query</span>
components, then return false.</p>
and <var>url</var>'s <span data-x="concept-url-path">path</span> is different from
<var>documentURL</var>'s <span data-x="concept-url-path">path</span>, then return false.</p>

<p class="note">Even when the previous step's condition passes, the origins can mismatch due to
sandboxing causing <var>document</var>'s <span data-x="concept-document-origin">origin</span>
Expand Down Expand Up @@ -85128,13 +85127,8 @@ interface <dfn interface>History</dfn> {
<tr>
<td>("<code data-x="">https</code>", "<code data-x="">example.com</code>", null, null)
<td><code data-x="">about:blank</code>
<td><code data-x="">about:blank#hash</code>
<td><code data-x="">about:blank?search#hash</code>
<td>✅
<tr>
<td>("<code data-x="">https</code>", "<code data-x="">example.com</code>", null, null)
<td><code data-x="">about:blank</code>
<td><code data-x="">about:blank?search</code>
<td>❌
<tr>
<td>("<code data-x="">https</code>", "<code data-x="">example.com</code>", null, null)
<td><code data-x="">about:blank</code>
Expand All @@ -85150,16 +85144,11 @@ interface <dfn interface>History</dfn> {
<td><code data-x="">blob:https://example.com/77becafe-657b-4fdc-8bd3-e83aaa5e8f43</code>
<td><code data-x="">blob:https://example.org/anything</code>
<td>❌
<tr>
<td><span data-x="concept-origin-opaque">opaque</span>
<td><code data-x="">https://example.com/home</code>
<td><code data-x="">https://example.com/home#about</code>
<td>✅
<tr>
<td><span data-x="concept-origin-opaque">opaque</span>
<td><code data-x="">https://example.com/home</code>
<td><code data-x="">https://example.com/home?page=shop</code>
<td>
<td>
<tr>
<td><span data-x="concept-origin-opaque">opaque</span>
<td><code data-x="">https://example.com/home</code>
Expand All @@ -85168,13 +85157,8 @@ interface <dfn interface>History</dfn> {
<tr>
<td><span data-x="concept-origin-opaque">opaque</span>
<td><code data-x="">data:text/html,foo</code>
<td><code data-x="">data:text/html,foo#hash</code>
<td><code data-x="">data:text/html,foo?search#hash</code>
<td>✅
<tr>
<td><span data-x="concept-origin-opaque">opaque</span>
<td><code data-x="">data:text/html,foo</code>
<td><code data-x="">data:text/html,foo?search</code>
<td>❌
<tr>
<td><span data-x="concept-origin-opaque">opaque</span>
<td><code data-x="">data:text/html,foo</code>
Expand Down

0 comments on commit 74c6fd2

Please sign in to comment.