<commit_before>(function(){
/* read the design doc for explaination on the comments */

  var open = true;

  chrome.runtime.onMessage.addListener( function(message,sender,sendResponse) {
    if (message === "cp-toggle") {
      document.querySelector('cp-main').setAttribute("toggle", open);
      open = !open;
    }
  });

  chrome.runtime.sendMessage("cp-init");

  rehostPage();

  function rehostPage() {
    // create and open panel
    var currentTabUrl=document.URL;
    var extensionUrl=chrome.extension.getURL("");
    var cpMainUrl=chrome.extension.getURL("content_push/cp-main.html");
    var cpGlobalsUrl=chrome.extension.getURL("content_push/cp-globals.html");
    var cssUrl=chrome.extension.getURL("styles/main.css");

    // remove document content and add new head and body
    document.removeChild(document.documentElement);
    var html = document.createElement('html');
    var head = document.createElement('head');
    var body = document.createElement('body');
    body.setAttribute('unresolved', '');

    var base = document.createElement('base');
    base.setAttribute('href',extensionUrl);
    head.appendChild(base);

    var link = document.createElement('link');
    link.rel = 'stylesheet';
    link.href = cssUrl;<commit_msg>[content_script] some inert formatting changes.<commit_after>(function () {
  var open = true;

  chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) {
    if (message === 'cp-toggle') {
      document.querySelector('cp-main').setAttribute('toggle', open);
      open = !open;
    }
  });

  chrome.runtime.sendMessage("cp-init");

  rehostPage();

  function rehostPage () {
    // create and open panel
    var currentTabUrl = document.URL;
    var extensionUrl = chrome.extension.getURL('');
    var cpMainUrl = chrome.extension.getURL('content_push/cp-main.html');
    var cpGlobalsUrl = chrome.extension.getURL('content_push/cp-globals.html');
    var cssUrl = chrome.extension.getURL('styles/main.css');

    // remove document content and add new head and body
    document.removeChild(document.documentElement);
    var html = document.createElement('html');
    var head = document.createElement('head');
    var body = document.createElement('body');
    body.setAttribute('unresolved', '');

    var base = document.createElement('base');
    base.setAttribute('href', extensionUrl);
    head.appendChild(base);

    var link = document.createElement('link');
    link.rel = 'stylesheet';
    link.href = cssUrl;
{'fraction_non_alphanumeric': 0.1431419457735247, 'fraction_numerical': 0.0, 'mean_word_length': 3.9781746031746033, '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': '6870448', 'n_tokens_mistral': 719, 'n_tokens_neox': 700, 'n_words': 146}