support multiple windows

This commit is contained in:
pomu0325
2020-08-24 12:22:17 +09:00
parent f0b8dd7a08
commit d43ad64aab
2 changed files with 18 additions and 2 deletions

View File

@@ -89,7 +89,8 @@ class WakaTimeCore {
browser.idle.queryState(config.detectionIntervalInSeconds).then((newState) => {
if (newState === 'active') {
// Get current tab URL.
browser.tabs.query({active: true}).then((tabs) => {
browser.tabs.query({currentWindow: true, active: true}).then((tabs) => {
if (tabs.length == 0) return;
var currentActiveTab = tabs[0];
var debug = false;