I'm making an app in Node-Webkit that shows different sites, videos and pictures after each other, where I show the images in an image-tag, the videos in a video-tag and the sites in an iframe-tag in an iframe, and I replace one with the other. The problem is that when I look in the chrome dev-tools, the Dom Node Count keeps increasing, as does the Document Count. It looks like when I replace an iframe with something else (an image or another website), it does not get removed from memory (memory also increases over time). The video and image tags don't have these leftovers.
This is a problem because it is supposed to run for a long timespan, and eventually this memory leak will kill the app.
What I do is basically this:
document.getElementById("content").innerHTML = "<iframe src='http://www.google.com' />";
document.getElementById("content").innerHTML = "<video src='some.video.source' />";
but then when I look at the timeline in the nodes that were added when inserting the iframe are not removed.
Can anyone help me with how to clear the iframe (and it's content) ?
I am seeing the same issue, and believe it is caused by this issue: https://bugs.webkit.org/show_bug.cgi?id=31253