获取当前窗口ID

  1. chrome.windows.getCurrent(function(currentWindow)
  2. {
  3. console.log('当前窗口ID:' + currentWindow.id);
  4. });