[번역] Cross-window communication

정은경·2021년 5월 10일
0

👸 Front-End Queen

목록 보기
152/266

아래의 글을 번역하였습니다.
Cross-window communication(https://ko.javascript.info/cross-window-communication)

Cross-window communication

Same Origin(또는 동일 사이트) 정책은 윈도우/프레임 간의 접근을 제한한다.

만약 사용자가 두개의 페이지를 열었고, 한 페이지는 "john-smith.com"이고, 다른 한 페이지는 "gmail.com"일 때,
"john-smith.com"으로 부터 가져온 자바스크립트를 이용해서 "gmail.com"에서 수신한 이메일들을 읽고 싶지 않기 때문이다.

그래서, Same Origin 정책은 정보도난(information theft)으로부터 사용자를 보호를 목적으로 한다.

Same Origin

In action: iframe

Windows on subdomains: document.domain

Iframe: wrong document pitfall

Collection: window.frames

The "sandbox" iframe attribute

Cross-window messaging

postMessage

onmessage

Summary

profile
#의식의흐름 #순간순간 #생각의스냅샷

0개의 댓글