On Sat, Jul 14, 2012 at 11:28 AM, Doug Koellmer
<dou...@gmail.com> wrote:
... I'm moving back to caja integration now for a bit.
Great, good to hear from you again!
... I notice now that I'm getting "leaked" iframes, specifically <iframe style="display: none; " width="0" height="0" class="es53-guest-frame"></iframe>.
These are iframes that Caja uses to squirrel away the untrusted code, yes. For each gadget, Caja creates one of these.
First, you need to be able to track resource usage in your browser. Chrome's
View -> Developer -> Developer Tools -> Profiles -> Take Heap Snapshot
is useful in that regard. Next, when you do a caja.load() --
caja.load(..., function(frame) {
// "frame.iframe" is a direct reference to the
// "es53-guest-frame" that has been created
})
If you don't need it any more, you can simply do:
where "blank.html" is some empty HTML file you have somewhere. Then you can say:
frame.iframe.parentNode.removeChild(frame.iframe);
The question is whether this is sufficient to sufficiently stop the leaks. A lot of the Caja data structures are actually in a separate iframe, and we have not audited our code for any dangling references. If you could try this technique (as a vanguard of a new way...) and let us know how it works, that would be awesome.
Ihab
Ihab A.B. Awad, Palo Alto, CA