スキップしてメイン コンテンツに移動

投稿

ラベル(permission)が付いた投稿を表示しています

Check window.opener permission

Issue I tried to access some properties (or call methods) defined in http parent window via window.opener in pop-upped https window, which is created from the parent window. But it simply fails when accessing window.opener.a_property in the child window because the protocol is different between the child and parent window. e.g. http and https Remember this browser behavior is absolutely correct. The point of this post is how to avoid simply stopping javascript when accessing properties in window.opener. Browsers I confirmed this permission issue happens FireFox 17.0.1 and Internet Explore 9. Somehow Chrome doesn't complain it at all. the code simply passed. Solution In order to avoid this, I wrote the following conditions to detect the window.opener is accessible or not before accessing window.opener, but all of them don't return expected result at all. if(window.opener) // return true :( if(window.opener == undefined) // return true :( Finally I have reached at