mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-09 04:39:03 +02:00
Any number of outer windows may be attached to a BrowsingContext over its lifetime. While the BrowsingContext is alive, it's easy to keep track of which of these is active, and therefore which of its inner windows is active. After it has been discarded, though, it discards its docShell reference, so all we can tell about an inner window is whether it is active for its own outer window, but not whether it should be considered active for its BrowsingContext. This patch updates the BrowsingContext detach logic to store a flag on the current inner window recording that it was active when its BrowsingContext was detached, and then later checks that flag to determine if it is the current window for a detached BrowsingContext. Differential Revision: https://phabricator.services.mozilla.com/D49032 --HG-- extra : moz-landing-system : lando
24 lines
629 B
HTML
24 lines
629 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title></title>
|
|
<script>
|
|
function isCurrentWinnerWindow() {
|
|
// If we are the current inner window for our BrowsingContext, bare word
|
|
// access to `name` will return "". If we are not, it will throw.
|
|
// Note that this is *not* the same as accessing `window.name`, which
|
|
// will go through our WindowProxy, which will always forward it to the
|
|
// currently-active inner window.
|
|
try {
|
|
void name;
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
</body>
|
|
</html>
|