-1

I m beginner in chrome extension. I just wanna a solution for my doubt.

my extension popup get closed when i click outside of it or when i open a new tab in the browser.

I need a solution for my extension popup to remain open in every tab and it should close when i click close (x) icon, so it will work individually with the respective tabs until i close that popup.

Plz help me in that.

Thanks in Advance.

  • 1
    Possible duplicate of [How to keep Google Chrome Extension popup open?](http://stackoverflow.com/questions/4146930/how-to-keep-google-chrome-extension-popup-open) – wOxxOm Oct 03 '16 at 22:42
  • 1
    Out of 5 paragraphs in your question, only 2 are relevant. The rest is [noise](https://meta.stackoverflow.com/questions/260776/should-i-remove-fluff-when-editing-questions). – Xan Oct 03 '16 at 22:47
  • 1
    So please read [How to Ask guide](https://stackoverflow.com/help/how-to-ask), and trim your question (and title!) to be more useful. – Xan Oct 03 '16 at 22:54

1 Answers1

0

A popup will close when it loses focus: be it by switching tabs or simply clicking inside the tab. There is nothing you can do about it.

Likewise, there can't be several copies of a popup - when it closes, it's destroyed. You may keep per-tab data and use that when the popup opens, but that won't solve "must be visible when switching to previous tab".

The user experience you describe is probably best engineered as a Content Script injecting your UI elements into the page's DOM. Be warned that it's hard to make it coexist with all pages.

Community
  • 1
  • 1
Xan
  • 74,770
  • 16
  • 179
  • 206