<commit_before>// Mock not supported chrome.* API for Firefox and Electron

window.isElectron = window.navigator &&
  window.navigator.userAgent.indexOf('Electron') !== -1;

// Background page only
if (
  window.isElectron &&
  location.pathname === '/_generated_background_page.html' ||
  navigator.userAgent.indexOf('Firefox') !== -1
) {
  chrome.runtime.onConnectExternal = {
    addListener() {}
  };
  chrome.runtime.onMessageExternal = {
    addListener() {}
  };

  if (window.isElectron) {
    chrome.notifications = {
      onClicked: {
        addListener() {}
      },
      create() {},
      clear() {}
    };
    chrome.contextMenus = {
      onClicked: {
        addListener() {}
      }
    };
  } else {
    chrome.storage.sync = chrome.storage.local;
    if (!chrome.runtime.onInstalled) {
      chrome.runtime.onInstalled = {
        addListener: cb => cb()
      };
    }
  }
}<commit_msg>Revert "Support for `chrome.runtime.onInstalled` on Firefox"<commit_after>// Mock not supported chrome.* API for Firefox and Electron

window.isElectron = window.navigator &&
  window.navigator.userAgent.indexOf('Electron') !== -1;

// Background page only
if (
  window.isElectron &&
  location.pathname === '/_generated_background_page.html' ||
  navigator.userAgent.indexOf('Firefox') !== -1
) {
  chrome.runtime.onConnectExternal = {
    addListener() {}
  };
  chrome.runtime.onMessageExternal = {
    addListener() {}
  };

  if (window.isElectron) {
    chrome.notifications = {
      onClicked: {
        addListener() {}
      },
      create() {},
      clear() {}
    };
    chrome.contextMenus = {
      onClicked: {
        addListener() {}
      }
    };
  } else {
    chrome.storage.sync = chrome.storage.local;
    chrome.runtime.onInstalled = {
      addListener: cb => cb()
    };
  }
}
{'fraction_non_alphanumeric': 0.1515986769570011, 'fraction_numerical': 0.002205071664829107, 'mean_word_length': 2.63, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3384662', 'n_tokens_mistral': 597, 'n_tokens_neox': 568, 'n_words': 95}