"use strict";

function sendToggle(tabs) {
  let id = tabs[0].id;
  browser.tabs.sendMessage(id, {request: 'toggle'}).then(m => {
    if (m.toggle) {
      browser.browserAction.setBadgeText({text: "", tabId: id});
    } else {
      browser.browserAction.setBadgeText({text: "🞬", tabId: id});
    }
  });
}

browser.browserAction.onClicked.addListener(() => {
  browser.tabs.query({currentWindow: true, active: true}).then(sendToggle);
});

/* Copyright (c) 2016 Dmitri Kourennyi */
/* See the file COPYING for copying permission. */
'use strict';

Remove unused code in background script
Remove unused code in background script
