Question

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?

Was it helpful?

Solution

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?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top