Perché in Xul di XBL non riesco a chiamare un metodo da window.opener?
-
08-10-2019 - |
Domanda
Ho un metodo XBL:
<method name="getValue">
<body>
<![CDATA[
return "TEST"
]]>
</body>
</method>
e, in una nuova finestra aperta, che io chiamo:
print(window.opener.getChannel()); // this prints the value
, ma si dice che
window.opener.getChannel non è un la funzione
perché?
Soluzione
Per window.opener documentazione MDN dice:
Returns a reference to the window that opened this current window.
A meno che il XBL sta estendendo quella finestra non avrete il metodo, e io sono sicuro se è possibile estendere la finestra in quel modo da XBL. Quello che voglio dire è che -? Se si stesse estendendo vbox o tale è OK, si può fare getDocumentById e quindi chiamare il metodo su tale oggetto, ma come si farebbe con la finestra
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow