kango extension popup wont open

120 views Asked by At

I'm making a cross browser extension using Kango. I'm sending a message from the content script to the background page and I want that a popup displays when the message is received by the background script. Here's what I have so far

background script:

kango.addMessageListener('Content2Background', function(event) {
    kango.ui.browserButton.setPopup({url:'popup.html', width: 710, height:510});
    console.log(event.data);
});

and in the content script:

kango.dispatchMessage('Content2Background', "Hey");

This runs, the console displays the message in the console, but the popup is not enabled. Any ideas why?

1

There are 1 answers

0
Irtza.QC On BEST ANSWER

It turns out that setPopup just adds the popup to the button. So clicking it again is what opens the popup. However, any message listeners or senders previously attached to the button will be lost. So beware or be square.