2011/07/13

[JavaScript]ドメインが違うiframeのopenerについて

基本的には、iframeのドメインがメインのドメインと違う場合は、クロスドメインで、直接アクセスできないのですが、IEの場合は、どうやらopenerの書き換えはできるようだ。

で、それは、何で知ったのかというと、↓

Contains the NIX (Native IE XDC) method transport for cross-domain communication. It exploits the fact that Internet Explorer allows a window that is the parent of an iframe to set said iframe window's opener property to an object.This object can be a function that in turn can be used to send a message despite same-origin constraints.

via:nixtransport.js

さらに、こちらでも、資料があります。

Possible Values
・・・省略・・・
The property is read/write. The property has no default value.

via:opener Property

つまり、外からopenerの値を変更できるということ。

これは、結構でかい。特に通信するときは。

覚えておいて、損はないかも。

0 コメント:

コメントを投稿