1
votes

I have create a chrome extension and now i wanna create an extension for firefox. I use most of the code in chrome extension.

But now i encountered a problem. In chrome, extension can have an icon on the toolbar and when clicked, there can be a popup page. But there is no popup in firefox. I use a panel instead.

And the question is how can i close the panel? I have used window.close() in the panel for some event. But this will close the whole firefox window.

2
You question doesn't have any real info on what you are actually doing. What are you using to display your "popup", widget or panel? - Wladimir Palant
popup page in chrome is a page show up when you click the button. It is not a new window. It is not a widget in firefox. It should be a panel. - aisensiy
I know what a popup is in Chrome - but your question is about Firefox and there is no direct equivalent in Firefox. So far you completely failed to explain what your are doing in Firefox. Feel free to edit your post and add this information, I will revert my downvote then. - Wladimir Palant
Thanks for your advice. I edited my question again. - aisensiy

2 Answers

1
votes

A panel is not a window - it is just a single tag in the XUL document (browser window's document in your case). You should use the API provided for this tag to manipulate it, in particular the panel.hidePopup() method:

document.getElementById("my-panel").hidePopup();