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