Skip to content Skip to sidebar Skip to footer

Passing Values To Iframe Inside Xul Panel

I am creating a firefox extension that has a button on the toolbar that will show below custom content that i will set. I was using a XUL file to create the structure of this conte

Solution 1:

You cannot really "send" a value to an iframe but you can leave it in a place where the code running inside the iframe can find it - e.g. in an expando property of that iframe tag:

var frame = document.getElementById("myext-toolbar-menu");
frame._myExtConfig = config;
frame.src = "chrome://myext/content/login.xul";

The code running in chrome://myext/content/login.xul can do the following then:

var config = window.frameElement._myExtConfig;

For reference: window.frameElement

Post a Comment for "Passing Values To Iframe Inside Xul Panel"