<commit_before>import ext from "./utils/ext";

ext.runtime.onMessage.addListener(
  function(request, sender, sendResponse) {
    if(request.action === "perform-save") {
      console.log("Extension Type: ", "/* @echo extension */");
      console.log("PERFORM AJAX", request.data);

      sendResponse({ action: "saved" });
    }
  }
);

chrome.webRequest.onCompleted.addListener(function (tabId, changeInfo, tab) {
  console.log("some request completed");
},
{
  urls: ["https://*.google.com/*.js"]
 },
 ["responseHeaders"]);
<commit_msg>Sending message query-flight whenever network request<commit_after>import ext from "./utils/ext";

ext.runtime.onMessage.addListener(
  function(request, sender, sendResponse) {
    if(request.action === "perform-save") {
      console.log("Extension Type: ", "/* @echo extension */");
      console.log("PERFORM AJAX", request.data);

      sendResponse({ action: "saved" });
    }
  }
);

chrome.webRequest.onCompleted.addListener(function(requestInfo) {
  console.log("some request completed");
  // Tell contentScript to checkIfFlightInfos
  chrome.tabs.query({ currentWindow: true, active: true }, (tabs) => {
    if(tabs && tabs[0] && tabs[0].id) {
      chrome.tabs.sendMessage(tabs[0].id, { action: "query_flights" });    
    }
  })
},
{
  urls: ["https://*.google.com/flights/rpc", "https://*.google.ca/flights/rpc", "https://*.google.ca/*.js", "https://*.google.com/*.js"]
 },
 ["responseHeaders"]);


//  chrome.tabs.onUpdated.addListener(function(tabId, info) {
//   if(info.status === 'complete') {
//     console.log("info is complete");
//   } 
//   console.log("tab is updated");
// });
{'fraction_non_alphanumeric': 0.20024345709068778, 'fraction_numerical': 0.0018259281801582471, 'mean_word_length': 3.7241379310344827, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 5, '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': '2941950', 'n_tokens_mistral': 537, 'n_tokens_neox': 525, 'n_words': 91}