demo · v131

window.open with the new COOP value

The companion demo shows the COOP matrix as a table. This one is the live test: open a popup three ways — window.open(), <a target="_blank" rel="opener">, and <a target="_blank"> — and inspect window.opener from inside the popup. With noopener-allow-popups, opener is severed regardless of how the popup was triggered.

scenario A

window.open() with features

scenario B

<a target="_blank">

open with rel="opener"

log (look at the popup's window.opener)

the test

// what we open
const popupHtml = `<script>
  document.body.textContent = "window.opener = " + window.opener;
  // post back so the log on the opener page can show it
  if (window.opener) window.opener.postMessage({ opener: !!window.opener }, "*");
</script>`;

const url = "data:text/html;base64," + btoa(popupHtml);
window.open(url, "_blank", "noopener=no");
// Under COOP: noopener-allow-popups (Chrome 131), opener is always null.

see also