문제

I have a XBL method:

        <method name="getValue">
            <body>
                <![CDATA[
                    return "TEST"
                ]]>
            </body>
        </method>

and, in a new opened window, I call:

print(window.opener.getChannel()); // this prints the value

but it says that

window.opener.getChannel is not a function

why?

도움이 되었습니까?

해결책

For window.opener MDN documentation says:

Returns a reference to the window that opened this current window.

Unless your XBL is extending that window you won't have the method, and I'm unsure if you can extend window in that manner by XBL. What I mean by that is - if you were extending vbox or such it's OK, you can do getDocumentById and then call method on that object, but how would you do it with window?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top