<commit_before>function injectScript() {
  let script = document.createElement('script')
  let body = document.getElementsByTagName('body')[0]
  script.src = chrome.runtime.getURL('dime.logger.js')
  script.type = 'text/javascript';
  script.setAttribute('chrome', 'true')
  body.appendChild(script);
  window.addEventListener('message', function(event) {
    if(event.data && event.data.type && event.data.type === 'pageDataWithDimeStructure') {
      chrome.runtime.sendMessage({dataWithDimeStructure: event.data.payload})
    }
  })
}
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
  if (request.data.url) {
    console.log('tab url changed')
    chrome.storage.local.get(['skipSites'], (v)=> {
      let {skipSites} = v
      const notLocalhost = /^http:\/\/\w+(\.\w+)*(:[0-9]+)?\/?(\/[.\w]*)*$/
      if (skipSites.indexOf(window.location.href.replace(/.*?:\/\//g, "")) === -1 && !notLocalhost.test(window.location.href))
        //console.log(`site is not in the filter list: ${skipSites}, continue`)
        injectScript();
    })
  }
})

<commit_msg>quick fix for compatibility of chromium 48 in ubuntu<commit_after>function injectScript() {
  let script = document.createElement('script')
  let body = document.getElementsByTagName('body')[0]
  script.src = chrome.runtime.getURL('dime.logger.js')
  script.type = 'text/javascript';
  script.setAttribute('chrome', 'true')
  body.appendChild(script);
  window.addEventListener('message', function(event) {
    if(event.data && event.data.type && event.data.type === 'pageDataWithDimeStructure') {
      chrome.runtime.sendMessage({dataWithDimeStructure: event.data.payload})
    }
  })
}
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
  if (request.data.status === 'complete') {
    console.log('tab url changed')
    chrome.storage.sync.get(['skipSites'], (v)=> {
      let {skipSites} = v
      const notLocalhost = /^http:\/\/\w+(\.\w+)*(:[0-9]+)?\/?(\/[.\w]*)*$/
      if (skipSites.indexOf(window.location.href.replace(/.*?:\/\//g, "")) === -1 && !notLocalhost.test(window.location.href))
        //console.log(`site is not in the filter list: ${skipSites}, continue`)
        injectScript();
    })
  }
})


{'fraction_non_alphanumeric': 0.19901168014375561, 'fraction_numerical': 0.004492362982929021, 'mean_word_length': 3.8518518518518516, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2457997', 'n_tokens_mistral': 729, 'n_tokens_neox': 710, 'n_words': 115}