如果
document源与原始源相同,
document并且已通过用户操作打开,则可以将参数作为查询字符串传递。
document.querySelector("input[type=button]").onclick = e => { // pass key, value pairs to `test.html` const test = window.open(`test.html?${key}=${value}`, "_blank"); }在打开
window获取并解析
location.search
onload = () => { // do stuff with key, value pairs passed from `window.opener` console.log([...new URLSearchParams(location.search).entries()]) }plnkr
http://plnkr.co/edit/MlCQZpkfBXFwxdR6gz5x?p=preview



