我想以编程方式打开一个新窗口(即 via window.open)并修改内容而不需要
window.opener让我自己很容易通过子窗口中的非空值进行反向 tabnabbingReferer通过header泄露潜在敏感的 url 或查询参数使用该noreferrer功能(即window.open(url, target, "noreferrer"))似乎是最直接的选项,但根据规范(请参阅步骤 15),这将始终导致返回值为null。
有没有办法打开一个新窗口而不传递Referer标题,设置opener为null,并且仍然对打开的窗口有非空引用?
var otherWindow = window.open();
otherWindow.opener = null;
otherWindow.location = targetUrl;
Run Code Online (Sandbox Code Playgroud)