Cross-Origin Opener Policy (COOP)
Why COOP Is Important
Without COOP, a page opened via window.open() can access properties of the opener window if they share an origin, or can navigate the opener to a different URL even cross-origin. This creates opportunities for tabnabbing attacks where a link opens a new tab, and that tab's JavaScript navigates the original tab to a phishing page.
COOP: same-origin isolates your browsing context, preventing any cross-origin window from interacting with it. This is one of the requirements (along with COEP) for enabling powerful browser APIs like SharedArrayBuffer and high-resolution timers, which were restricted after the Spectre CPU vulnerability was discovered.
For most websites, setting COOP: same-origin is beneficial and has minimal impact on functionality. The main compatibility concern is if your site relies on cross-origin window references, such as OAuth login popups that communicate back to the opener. In those cases, COOP: same-origin-allow-popups is a less restrictive option.
How to Test for COOP
A security audit checks for the Cross-Origin-Opener-Policy header. For sites that do not use cross-origin window communication, same-origin is recommended. If you use OAuth popups, test same-origin-allow-popups to confirm compatibility.