<commit_before>// Load script from storage, and execute
Extension = (function () {
  function Extension() {}

  Extension.prototype.addScript = function (src) {
    var s = document.createElement('script');
    s.src = src;
    document.body.appendChild(s);
  };

  Extension.prototype.onReadyComplete = null;
  Extension.prototype.insertCSS = function (details, callback) {
    chrome.runtime.sendMessage({
      type: MESSAGE_TYPES.TABS_INSERT_CSS, 
      data: {
        details: details
      }
    }, callback);
  };

  Extension.prototype.executeScript = function (details, callback) {
    chrome.runtime.sendMessage({
      type: MESSAGE_TYPES.TABS_EXECUTE_SCRIPT, 
      data: {
        details: details
      }
    }, callback);
  };
  Extension.prototype.executeScriptFromURL = function (url, callback) {
    XHRHelper.request({
      url: url,
      success: function(xhr) {
        this.executeScript({
          code: xhr.responseText
        }, callback);
      }.bind(this)
    });
  };
  return new Extension();
})();

chrome.storage.local.get('script', function (data) {
  var __script = data['script'];
  if (__script) {
    Extension.executeScript({
        code: __script<commit_msg>xhr fix<commit_after>// Load script from storage, and execute
Extension = (function () {
  function Extension() {}

  Extension.prototype.addScript = function (src) {
    var s = document.createElement('script');
    s.src = src;
    document.body.appendChild(s);
  };

  Extension.prototype.onReadyComplete = null;
  Extension.prototype.insertCSS = function (details, callback) {
    chrome.runtime.sendMessage({
      type: MESSAGE_TYPES.TABS_INSERT_CSS, 
      data: {
        details: details
      }
    }, callback);
  };

  Extension.prototype.executeScript = function (details, callback) {
    chrome.runtime.sendMessage({
      type: MESSAGE_TYPES.TABS_EXECUTE_SCRIPT, 
      data: {
        details: details
      }
    }, callback);
  };
  Extension.prototype.executeScriptFromURL = function (url, callback) {
    var xhr = new XMLHttpRequest();
    xhr.open("GET", url);
    xhr.onload = function () {
      this.executeScript({
          code: xhr.responseText
        }, callback);
    }.bind(this);
    xhr.send();
  };
  return new Extension();
})();

chrome.storage.local.get('script', function (data) {
  var __script = data['script'];
  if (__script) {
    Extension.executeScript({
        code: __script
{'fraction_non_alphanumeric': 0.13143798928718584, 'fraction_numerical': 0.0, 'mean_word_length': 2.9161290322580644, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5427659', 'n_tokens_mistral': 736, 'n_tokens_neox': 717, 'n_words': 148}