How to close the current extension tab?

后端 未结 5 863
陌清茗
陌清茗 2020-12-18 18:46

I\'m trying to close the Options page of the extension. I have a Cancel button and I\'m using this code:

chrome.tabs.getCurrent(null, function(tab) {
  chrom         


        
5条回答
  •  鱼传尺愫
    2020-12-18 19:33

    In the options page, you can just do:

    window.close()
    

    If you wanted to use chrome.tabs.getCurrent, do you have tabs defined in the permissions section within the manifest?

提交回复
热议问题