<commit_before>function QminderBridge() {

  "use strict";
  
  var onLoadCallback = null;

  var receiveMessage = function(event) {
    if (event.data.secretKey) {
      if (onLoadCallback) {
        onLoadCallback(event.data.secretKey);
      }
    }
  };

  window.addEventListener("message", receiveMessage, false);
  
  this.onLoad = function(callback) {
    onLoadCallback = callback;
  };
  
  this.playAlertSound = function() {
    parent.postMessage({"command": "playAlertSound"}, "*");
  };
}

var QminderBridge = new QminderBridge();<commit_msg>Added method for getting parameters.<commit_after>function QminderBridge() {

  "use strict";
  
  var onLoadCallback = null;

  var receiveMessage = function(event) {
    if (event.data.secretKey) {
      if (onLoadCallback) {
        onLoadCallback(event.data.secretKey);
      }
    }
  };

  window.addEventListener("message", receiveMessage, false);
  
  this.onLoad = function(callback) {
    onLoadCallback = callback;
  };
  
  this.playAlertSound = function() {
    parent.postMessage({"command": "playAlertSound"}, "*");
  };
  
  this.getParameters = function() {
    var url = window.location.search.substring(1);
    var variables = url.split("&");

    var result = {};
    variables.forEach(function(variable) {
      var pair = variable.split("=");
      var id = pair[0];
      var value = pair[1];
      
      if (typeof result[id] == "undefined") {
        result[id] = value;
      }
      else if (typeof result[id] == "string") {
        result[id] = [result[id], value];
      }
      else {
        result[id].push(value);
      }
    });

    return result;
	};
}

var QminderBridge = new QminderBridge();
{'fraction_non_alphanumeric': 0.14522821576763487, 'fraction_numerical': 0.0017783046828689982, 'mean_word_length': 2.862700228832952, 'pattern_counts': {'":': 2, '<': 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': '6776351', 'n_tokens_mistral': 537, 'n_tokens_neox': 522, 'n_words': 101}