Chrome Extension popup.html disappears when clicking on the page

I am new to Chrome Extension. I have a popup.html that collects data and displays when mouse over on the current open page/tab. I also send data to popup.html on click on the current open page/tab.

The problem is when i click on the page data gets passed to the popup.html but popup.html disappears/closes. When i click on the extension again the data persists since i am persisting the data on a background page.

How do i avoid popup.html not to close/disappear on click on current open page/tab.

Thanks in advance

Upvotes: 3

Views: 4700

Answers (3)

I understood that pop.html does not persist on the screen, hence took up a different route by getting my extension on to the chrome dev tools. They perform the same actions such as an extension the pain is that your dev tools have to be open always.

For my use case keeping the console open does not make much of a difference. This post helped me a lot set this up.

Thanks for your suggestions

Upvotes: 1

Xan
Xan

Reputation: 77591

It is not possible.

The popup for Browser Actions / Page Actions is designed to close as soon as it loses focus. It is also not possible to programmatically open it.

You did correctly by making the background script handle the data. If you need persistent UI while you're interacting with a page, then your only option seems to be some HTML UI injected by a content script.

You might be interested in this question.

Upvotes: 3

Casey
Casey

Reputation: 107

I m not sure u can. There is a reason the page is named as popup. Although you can try notifications(https://developer.chrome.com/extensions/notifications) to provide the same functionality.

Upvotes: 0

Related Questions