<commit_before>/* jshint forin:true, noarg:false, noempty:true, eqeqeq:true, bitwise:true,
  strict:true, undef:true, curly:false, browser:true,
  unused:true,
  indent:2, maxerr:50, devel:true, node:true, boss:true, white:true,
  globalstrict:true, nomen:false, newcap:true, esnext: true, moz: true  */

/*global exports, require, console, Cc, Ci */

/** usage
  - on pages like the ui-debug page, use this to get current top bar notice
    for styling and debugging
  - must be used from a priv'd page, like about:addons
*/

let getnb = function () {
  let BROWSER = 'navigator:browser';
  let WM = Cc['@mozilla.org/appshell/window-mediator;1'].
             getService(Ci.nsIWindowMediator);

  function getMostRecentWindow(type) {
    return WM.getMostRecentWindow(type);
  }

  function getMostRecentBrowserWindow() {
    return getMostRecentWindow(BROWSER);
  }

  let win = getMostRecentBrowserWindow();
  // noficication
  let box = win.document.getElementById("high-priority-global-notificationbox");

  let notice = box.currentNotification;

  let messageImage = document.getAnonymousElementByAttribute(notice, "class", "messageImage");
  let messageText = document.getAnonymousElementByAttribute(notice, "class", "messageText");
  let closeButton = document.getAnonymousElementByAttribute(notice, "class", "messageCloseButton close-icon tabbable");

  return {
    win: win,
    box: box,
    //scoreEl: scoreEl,
    notice: notice,
    //which: which,
    messageImage: messageImage,
    messageText: messageText,
    closeButton: closeButton
  };
};

let loop = (thing, fn) [].forEach.call(thing, fn);<commit_msg>Nitfix on getnb-helper<commit_after>/* jshint forin:true, noarg:false, noempty:true, eqeqeq:true, bitwise:true,
  strict:true, undef:true, curly:false, browser:true,
  unused:true,
  indent:2, maxerr:50, devel:true, node:true, boss:true, white:true,
  globalstrict:true, nomen:false, newcap:true, esnext: true, moz: true  */

/*global exports, require, console, Cc, Ci */

/** usage
  - on pages like the ui-debug page, use this to get current top bar notice
    for styling and debugging
  - must be used from a priv'd page, like about:addons
*/

let getnb = function () {
  let BROWSER = 'navigator:browser';
  let WM = Cc['@mozilla.org/appshell/window-mediator;1'].
             getService(Ci.nsIWindowMediator);

  function getMostRecentWindow(type) {
    return WM.getMostRecentWindow(type);
  }

  function getMostRecentBrowserWindow() {
    return getMostRecentWindow(BROWSER);
  }

  let win = getMostRecentBrowserWindow();
  // noficication
  let box = win.document.getElementById("high-priority-global-notificationbox");

  let notice = box.currentNotification;

  let messageImage = document.getAnonymousElementByAttribute(notice, "class", "messageImage");
  let messageText = document.getAnonymousElementByAttribute(notice, "class", "messageText");
  let closeButton = document.getAnonymousElementByAttribute(notice, "class", "messageCloseButton close-icon tabbable");

  return {
    win: win,
    box: box,
    //scoreEl: scoreEl,
    notice: notice,
    //which: which,
    messageImage: messageImage,
    messageText: messageText,
    closeButton: closeButton
  };
};

let loop = (thing, fn) => [].forEach.call(thing, fn);
{'fraction_non_alphanumeric': 0.12224264705882353, 'fraction_numerical': 0.0024509803921568627, 'mean_word_length': 4.469011725293132, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '4035706', 'n_tokens_mistral': 1059, 'n_tokens_neox': 1012, 'n_words': 255}