Set and show PageAction popup at the same time

33 views
Skip to first unread message

Asad Dhamani

unread,
Apr 22, 2015, 2:21:23 AM4/22/15
to chromium-...@chromium.org

I'm working on an extension where I have to show a different popup for different conditions being met. Specifically, I show a login popup if the user is not logged in, and I show a normal popup if the user is logged in. I can't have a default popup because I want to onClicked event for the pageAction.

If I add a chrome.pageAction.setPopup inside the chrome.pageAction.onClicked event handler, I have to click the pageAction icon once again to see the popup, because setPopup only sets which popup to show. I've searched through the Chrome API documentation, and I couldn't find any method to show the popup. 

What I need is to know when the pageAction icon is clicked, and then show the popup. I could set the popup inside of a chrome.tabs.onUpdated event handler, but that would mean I wouldn't get the onClicked event. So is there some way to set and show the popup at once, or to know when the icon is clicked and show the popup at the same time?

Thanks.

Rob Wu

unread,
Apr 25, 2015, 4:25:09 AM4/25/15
to Asad Dhamani, Chromium-extensions
This is not possible at the moment, but you can star the next issue to follow the tracking bug: https://code.google.com/p/chromium/issues/detail?id=436489 ("Take browserAction.openPopup to stable, add pageAction.openPopup").

Kind regards,
 Rob
 https://robwu.nl

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/38259d0f-af87-48a5-96be-eea1b994e7ad%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Reply all
Reply to author
Forward
0 new messages