-
Notifications
You must be signed in to change notification settings - Fork 3k
Add a 'noopener' link attribute #290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20973,6 +20973,11 @@ interface <dfn>HTMLHyperlinkElementUtils</dfn> { | |
|
|
||
| </li> | ||
|
|
||
| <li><p>If <var>subject</var>'s <a href="#linkTypes">link types</a> include the <code | ||
| data-x="rel-noreferrer">noreferrer</code> or <code data-x="rel-noopener">noopener</code> keyword, | ||
| and <var>replace</var> is true, then <span data-x="disowned its opener">disown | ||
| <var>target</var>'s opener</span>.</p></li> | ||
|
|
||
| <li><p><span data-x="resolve a url">Resolve</span> the <span>URL</span> given by | ||
| <var>subject</var>'s <code data-x="attr-hyperlink-href">href</code> attribute, relative to | ||
| <var>subject</var>.</p></li> | ||
|
|
@@ -21472,6 +21477,13 @@ interface <dfn>HTMLHyperlinkElementUtils</dfn> { | |
| <td>Requires that the user agent not send an HTTP `<code data-x="http-referer">Referer</code>` (sic) header if the user follows the hyperlink.</td> | ||
| </tr> | ||
|
|
||
| <tr> | ||
| <td><code data-x="rel-noopener">noopener</code></td> | ||
| <td><em>not allowed</em></td> | ||
| <td><span data-x="hyperlink annotation">Annotation</span></td> | ||
| <td>Requires that any <span>browsing context</span> created by following the hyperlink must not have an <span>opener browsing context</span>.</td> | ||
| </tr> | ||
|
|
||
| <tr> | ||
| <td><code data-x="rel-pingback">pingback</code></td> | ||
| <td><span data-x="external resource link">External Resource</span></td> | ||
|
|
@@ -21985,14 +21997,29 @@ interface <dfn>HTMLHyperlinkElementUtils</dfn> { | |
| <span data-x="concept-request">request</span>'s <span | ||
| data-x="concept-request-referrer">referrer</span> to "<code data-x="">no-referrer</code>".</p> | ||
|
|
||
| <p>This keyword also <a href="#noopener">causes the <code data-x="dom-opener">opener</code> | ||
| attribute to remain null</a> if the hyperlink <span data-x="creating a new browsing context">creates</span> a new <span>browsing context</span>.</p> | ||
| <p class="note">For historical reasons, the <code data-x="rel-noreferrer">noreferrer</code> | ||
| keyword implies the behavior associated with the <code data-x="rel-noopener">noopener</code> | ||
| keyword when present on a hyperlink that <span data-x="creating a new browsing | ||
| context">creates</span> a new <span>browsing context</span>. That is, <code data-x=""><a | ||
| href="..." rel="noreferrer" target="_blank"></code> has the same behavior as <code | ||
| data-x=""><a href="..." rel="noreferrer noopener" target="_blank"></code>.</p> | ||
|
|
||
| </div> | ||
|
|
||
| <!-- v2: Would be nice to apply this to other elements too, e.g. letting <img> or CSS or <video> | ||
| hide the referrer --> | ||
|
|
||
| <h5>Link type "<dfn><code data-x="rel-noopener">noopener</code></dfn>"</h5> | ||
|
|
||
| <p>The <code data-x="rel-noopener">noopener</code> keyword may be used with <code>a</code> and | ||
| <code>area</code> elements. This keyword does not create a <span>hyperlink</span>, but <span | ||
| data-x="hyperlink annotation">annotates</span> any other hyperlinks created by the element (the | ||
| implied hyperlink, if no other keywords create one).</p> | ||
|
|
||
| <p>The keyword indicates that any newly created <span>browsing context</span> which results from | ||
| following the <span>hyperlink</span> will not have an <span>opener browsing context</span>, which | ||
| means that its <code data-x="dom-opener">window.opener</code> property will be <code | ||
| data-x="">null</code>.</p> | ||
|
|
||
| <h5>Link type "<dfn><code data-x="rel-pingback">pingback</code></dfn>"</h5> | ||
|
|
||
|
|
@@ -78394,33 +78421,19 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> { | |
|
|
||
|
|
||
| <dt id="noopener">If the user agent has been configured such that in this instance it will | ||
| create a new browsing context, and the browsing context is being requested as part of <span | ||
| data-x="following hyperlinks">following a hyperlink</span> whose <a href="#linkTypes">link | ||
| types</a> include the <code data-x="rel-noreferrer">noreferrer</code> keyword</dt> | ||
|
|
||
| <dd><p>A new <span>top-level browsing context</span> must be <span data-x="creating a new browsing context">created</span>. If the given browsing | ||
| context name is not <code data-x="">_blank</code>, then the new top-level browsing context's | ||
| name must be the given browsing context name (otherwise, it has no name). The chosen browsing | ||
| context must be this new browsing context. The creation of such a <span>browsing context</span> | ||
| is <dfn>a new start for session storage</dfn>.</p> | ||
|
|
||
| <p class="note">If it is immediately <span data-x="navigate">navigated</span>, then the | ||
| navigation will be done with <span>replacement enabled</span>.</p></dd> | ||
|
|
||
|
|
||
| <dt>If the user agent has been configured such that in this instance it will create a new | ||
| browsing context, and the <code data-x="rel-noreferrer">noreferrer</code> keyword doesn't | ||
| apply</dt> | ||
|
|
||
| <dd><p>A new <span>auxiliary browsing context</span> must be created, with the <span>opener | ||
| browsing context</span> being the current one. If the given browsing context name is not <code | ||
| data-x="">_blank</code>, then the new auxiliary browsing context's name must be the given | ||
| browsing context name (otherwise, it has no name). The chosen browsing context must be this new | ||
| browsing context.</p> | ||
|
|
||
| <p class="note">If it is immediately <span data-x="navigate">navigated</span>, then the | ||
| navigation will be done with <span>replacement enabled</span>.</p></dd> | ||
| create a new browsing context:</dt> | ||
|
|
||
| <dd> | ||
| <p>A new <span>auxiliary browsing context</span> must be created, with the <span>opener | ||
| browsing context</span> being the current one. If the given browsing context name is not | ||
| <code data-x="">_blank</code>, then the new auxiliary browsing context's name must be the | ||
| given browsing context name (otherwise, it has no name). The chosen browsing context must be | ||
| this new browsing context.</p> | ||
|
|
||
| <p class="note">If the newly created <span>browsing context</span> is immediately <span | ||
| data-x="navigate">navigated</span>, then the navigation will be done with <span>replacement | ||
| enabled</span>.</p> | ||
| </dd> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deduplicate this note by placing it below the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refactoring this completely. |
||
|
|
||
| <dt>If the user agent has been configured such that in this instance it will reuse the current | ||
| browsing context</dt> | ||
|
|
@@ -78826,8 +78839,23 @@ callback <dfn>FrameRequestCallback</dfn> = void (<span>DOMHighResTimeStamp</span | |
|
|
||
| </li> | ||
|
|
||
| <li><p><i>End</i>: Return the <code>WindowProxy</code> object of <var>target browsing | ||
| context</var>.</p></li> | ||
|
|
||
| <li> | ||
| <p><i>End</i>:</p> | ||
|
|
||
| <ol> | ||
|
|
||
| <li><p>If the result of <span data-x="split a string on commas">splitting <var>features</var> | ||
| on commas</span> contains the token "<code data-x="">noopener</code>", <span data-x="disowned | ||
| its opener">disown <var>target browsing context</var>'s opener</span>, and return <code | ||
| data-x="">null</code>.</p></li> | ||
|
|
||
| <li><p>Otherwise, return the <code>WindowProxy</code> object of <var>target browsing | ||
| context</var>.</p></li> | ||
|
|
||
| </ol> | ||
|
|
||
| </li> | ||
|
|
||
| </ol> | ||
|
|
||
|
|
@@ -118105,6 +118133,7 @@ INSERT INTERFACES HERE | |
| Charlene Wright, | ||
| Charles Iliya Krempeaux, | ||
| Charles McCathieNevile, | ||
| Charlie Reis, | ||
| Chris Apers, | ||
| Chris Cressman, | ||
| Chris Evans, | ||
|
|
@@ -118594,6 +118623,7 @@ INSERT INTERFACES HERE | |
| Sander van Lambalgen, | ||
| Sanjoy Pal, | ||
| Sarven Capadisli, | ||
| Scott Beardsley, | ||
| Scott González, | ||
| Scott Hess, | ||
| Sean Fraser, | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed!