我正在尝试关闭扩展程序的"选项"页面.我有一个取消按钮,我正在使用此代码:
chrome.tabs.getCurrent(null, function(tab) {
chrome.tabs.remove(tab.id, function() {});
});
Run Code Online (Sandbox Code Playgroud)
当我尝试使用它时,它总是会出现此错误:
Uncaught TypeError: Cannot call method 'getCurrent' of undefined
Run Code Online (Sandbox Code Playgroud)
代码有什么问题?