<commit_before>chrome.tabs.getSelected(null, function (tab) {
  var url = 'https://twitter.com/intent/tweet?url=' + encodeURI(tab.url) + '&text=' + encodeURIComponent(tab.title) + '&related=tdecs';
  chrome.windows.create({ url: url, width: 550, height: 295, type: 'panel', focused: true });
});<commit_msg>add auto-close window feature and center the window nicely<commit_after>chrome.browserAction.onClicked.addListener(function (tab) {
  chrome.tabs.getSelected(null, function (tab) {
    var url = 'https://twitter.com/intent/tweet?url=' + encodeURI(tab.url) + '&text=' + encodeURIComponent(tab.title) + '&related=tdecs';
    var width = 550;
    var left = (screen.width/2)-(width/2);
    chrome.windows.create({url: url, width: width, height: 290, top: 150, left: left, type: 'panel', focused: true}, function (window) {
      var _tabId = window.tabs[0].id;
      chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {
        if (tabId === _tabId) {
          if (changeInfo.status === 'complete' && /complete/.test(tab.url)) {
            chrome.windows.remove(window.id);
          }
        }
      });
    });
  });
});
{'fraction_non_alphanumeric': 0.17713787085514834, 'fraction_numerical': 0.015706806282722512, 'mean_word_length': 3.6816326530612247, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '1157552', 'n_tokens_mistral': 393, 'n_tokens_neox': 375, 'n_words': 78}