<commit_before>import { ToolkitStorage } from 'toolkit/core/common/storage';
import { getBrowser, getBrowserName } from 'toolkit/core/common/web-extensions';

const TOOLKIT_DISABLED_FEATURE_SETTING = 'DisableToolkit';

export class Popup {
  _storage = new ToolkitStorage();

  _browser = getBrowser();

  constructor() {
    const manifest = this._browser.runtime.getManifest();
    $('#versionNumber').text(manifest.version);
    $('.toolkit-name').text(manifest.name);

    Promise.all([
      this._storage.getStorageItem('options.dark-mode', { default: false }),
      this._storage.getFeatureSetting(TOOLKIT_DISABLED_FEATURE_SETTING, {
        default: false,
      }),
    ]).then(([isDarkMode, isToolkitDisabled]) => {
      this._applyDarkMode(isDarkMode);
      this._toggleToolkitDisabledUI(isToolkitDisabled);
    });
  }

  initListeners() {
    $('#reportBug').click(() => window.close());<commit_msg>issue-2177: fix report bug button in the extension popup not opening in Firefox (#2211)<commit_after>import { ToolkitStorage } from 'toolkit/core/common/storage';
import { getBrowser, getBrowserName } from 'toolkit/core/common/web-extensions';

const TOOLKIT_DISABLED_FEATURE_SETTING = 'DisableToolkit';

export class Popup {
  _storage = new ToolkitStorage();

  _browser = getBrowser();

  constructor() {
    const manifest = this._browser.runtime.getManifest();
    $('#versionNumber').text(manifest.version);
    $('.toolkit-name').text(manifest.name);

    Promise.all([
      this._storage.getStorageItem('options.dark-mode', { default: false }),
      this._storage.getFeatureSetting(TOOLKIT_DISABLED_FEATURE_SETTING, {
        default: false,
      }),
    ]).then(([isDarkMode, isToolkitDisabled]) => {
      this._applyDarkMode(isDarkMode);
      this._toggleToolkitDisabledUI(isToolkitDisabled);
    });
  }

  initListeners() {
    $('#reportBug').click(() => {
      setTimeout(() => window.close(), 50);
    });
{'fraction_non_alphanumeric': 0.14889232354456466, 'fraction_numerical': 0.005151983513652756, 'mean_word_length': 4.2771739130434785, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6864832', 'n_tokens_mistral': 591, 'n_tokens_neox': 585, 'n_words': 94}