Filipe Silva
Filipe Silva

Reputation: 21677

Iframe load event in firefox extension

I'm building a firefox extension that has an iframe inside a panel.

I use a xul file as src of the iframe.

When i click on a specific button inside the iframe, i want the iframe to be loaded again with the same src but hide some elements and show another ones. To do this hide/unhide, i have the code on the xul onload, and it works well loading the iframe the first time, or when changing the src.

But when i hide and show the panel with the same src, the onload isn't triggered again.

Should i be doing something before opening the panel the second time?

Upvotes: 0

Views: 435

Answers (1)

Wladimir Palant
Wladimir Palant

Reputation: 57691

Hiding and showing the frame doesn't reload it - it really only hides and shows it without touching the content. To reload a frame from outside do:

document.getElementById("my-frame").contentWindow.location.reload();

Or from inside the frame:

window.location.reload();

For reference: location.reload()

Upvotes: 1

Related Questions