window.opener
- window
A가 windowB를 열면B.opener는A이다.
js
// in https://facebook.com
const google = window.open('https://google.com/');
console.log(google.opener.location.href);
// https://facebook.com
// in https://facebook.com
const google = window.open('https://google.com/');
console.log(google.opener.location.href);
// https://facebook.com
Younho9 Notes