Closing popup window created by Google Chrome extension

后端 未结 4 2225
抹茶落季
抹茶落季 2020-12-02 14:53

I\'m trying to create a Chrome extension that is a replacement for the Delicious bookmarklet. I know there\'s already an extension that does it, but the problem with that ex

4条回答
  •  执念已碎
    2020-12-02 15:19

    I found a very easy work around to this. You just set the selected tab to True and the Popup disappears, like this...

    // remove popup by selecting the tab
    chrome.tabs.getSelected(null, function(tab) {
        chrome.tabs.update(tab.id, { selected: true } )
    });
    

提交回复
热议问题