Skip to content

Commit cd33503

Browse files
authored
Add examples for "is closing" and "disowned"
Closes #4417.
1 parent f57890b commit cd33503

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

source

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76323,6 +76323,25 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
7632376323
from a document">removed from the document</span>, has no associated browsing context, since that
7632476324
browsing context was <span data-x="a browsing context is discarded">discarded</span>.</p>
7632576325

76326+
<div class="example">
76327+
<p>The following example illustrates the various possibilities of a <span>browsing context</span>.
76328+
It can be <span>disowned</span>, <span>is closing</span>, neither, or both.</p>
76329+
76330+
<pre><code class="js">// Neither disowned nor is closing:
76331+
const popup1 = window.open();
76332+
76333+
// Disowned, but not is closing:
76334+
const popup2 = window.open();
76335+
popup2.opener = null;
76336+
76337+
// Not disowned, but is closing:
76338+
const popup3 = window.open();
76339+
popup3.close();
76340+
76341+
// Disowned, is closing:
76342+
const popup4 = window.open();
76343+
popup4.opener = null;
76344+
popup4.close();</code></pre></div>
7632676345

7632776346

7632876347
<h4>Creating browsing contexts</h4>

0 commit comments

Comments
 (0)