<commit_before>(function($){
  'use strict';

  // Initialize app module
  var app = app || {};

  // Assign chrome methods to local variables
  var storage = $.storage.sync;
  var panel   = $.devtools.panels;

  // App directory
  app.dir = 'dist/';

  // AJAX request for Chrome version
  var getChromeVersion = function(){
    var ajax = new XMLHttpRequest();
    // Chromium release tracker API
    ajax.open('GET', 'https://omahaproxy.appspot.com/mac');
    ajax.send(null);

    ajax.onreadystatechange = function(){
      if (ajax.readyState === 4) {
        if (ajax.status === 200) {
          return parseInt(ajax.responseText, 10);
        } else {
          console.log('Status Code: ' + ajax.status + '\nThere was an error with your request');
        }
      }
    };
  };

  // Method: load themes
  app.loadTheme = function(object){

    // AJAX load of stylesheet
    var _request = function(stylesheet){
      var ajax = new XMLHttpRequest();
      ajax.open('GET', './' + stylesheet);
      ajax.send(null);

      ajax.onreadystatechange = function(){
        if (ajax.readyState === 4) {
          if (ajax.status === 200) {
            return panel.applyStyleSheet(ajax.responseText);
          } else {
            return console.log('Status Code: ' + ajax.status + '\nThere was an error with your request');
          }
        }
      };
    };

    // GET theme
    _request(object.theme);

    // GET Canary CSS if pre-release (beta, canary, dev)
    if (/Chrome\/(\d\d)/.exec(navigator.userAgent)[1] > getChromeVersion()) {
      _request(object.isCanary);
    }
  };

  // Method: initialize app
  app.init = function(){

    var stylesDir = app.dir + 'styles/',
        pagePath  = app.dir + 'panel.html';

    // Create Devtools panel
    panel.create(
      'Theme',  // Panel title
      null,     // Panel icon
      pagePath, // Path of panel's HTML page
      null      // Callback
    );

    // Get theme from Chrome storage
    storage.get('devtools-theme', function(object){

      var theme = object['devtools-theme'] || 'solarized-dark';

      app.loadTheme({
        theme: stylesDir + 'themes/' + theme + '.css',
        isCanary: stylesDir + 'canary.css'
      });
    });
  };

  // Fire app
  app.init();
})(chrome);<commit_msg>Apply stylesheet for font-size override from chrome storage<commit_after>(function($){
  'use strict';

  // Initialize app module
  var app = app || {};

  // Assign chrome methods to local variables
  var storage = $.storage.sync;
  var panel   = $.devtools.panels;

  // App directory
  app.dir = 'dist/';

  // AJAX request for Chrome version
  var getChromeVersion = function(){
    var ajax = new XMLHttpRequest();
    // Chromium release tracker API
    ajax.open('GET', 'https://omahaproxy.appspot.com/mac');
    ajax.send(null);

    ajax.onreadystatechange = function(){
      if (ajax.readyState === 4) {
        if (ajax.status === 200) {
          return parseInt(ajax.responseText, 10);
        } else {
          console.log('Status Code: ' + ajax.status + '\nThere was an error with your request');
        }
      }
    };
  };

  // Method: load themes
  app.loadTheme = function(object, cb){

    // AJAX load of stylesheet
    var _request = function(stylesheet){
      var ajax = new XMLHttpRequest();
      ajax.open('GET', './' + stylesheet);
      ajax.send(null);

      ajax.onreadystatechange = function(){
        if (ajax.readyState === 4) {
          if (ajax.status === 200) {
            panel.applyStyleSheet(ajax.responseText);
            cb();
          } else {
            return console.log('Status Code: ' + ajax.status + '\nThere was an error with your request');
          }
        }
      };
    };

    // GET theme
    _request(object.theme);

    // GET Canary CSS if pre-release (beta, canary, dev)
    if (/Chrome\/(\d\d)/.exec(navigator.userAgent)[1] > getChromeVersion()) {
      _request(object.isCanary);
    }
  };

  // Method: initialize app
  app.init = function(){

    var stylesDir = app.dir + 'styles/',
        pagePath  = app.dir + 'panel.html';

    // Create Devtools panel
    panel.create(
      'Theme',  // Panel title
      null,     // Panel icon
      pagePath, // Path of panel's HTML page
      null      // Callback
    );

    // Get theme from Chrome storage
    storage.get('devtools-theme', function(object){

      var theme = object['devtools-theme'] || 'solarized-dark';

      app.loadTheme({
        theme: stylesDir + 'themes/' + theme + '.css',
        isCanary: stylesDir + 'canary.css'
      }, function(){
        // Get fontSize from Chrome storage
        storage.get('devtools-fontSize', function(object){

          var fontSize = object['devtools-fontSize'];

          if (fontSize){
            var styles = ':host-context(.platform-mac) .monospace, :host-context(.platform-mac) .source-code, body.platform-mac .monospace, body.platform-mac .source-code, body.platform-mac ::shadow .monospace, body.platform-mac ::shadow .source-code { font-size: ' + fontSize + 'px !important; } :host-context(.platform-windows) .monospace, :host-context(.platform-windows) .source-code, body.platform-windows .monospace, body.platform-windows .source-code, body.platform-windows ::shadow .monospace, body.platform-windows ::shadow .source-code { font-size: ' + fontSize + 'px !important; } :host-context(.platform-linux) .monospace, :host-context(.platform-linux) .source-code, body.platform-linux .monospace, body.platform-linux .source-code, body.platform-linux ::shadow .monospace, body.platform-linux ::shadow .source-code { font-size: ' + fontSize + 'px !important; }';
            panel.applyStyleSheet(styles);
          }
        });
      });
    });
  };

  // Fire app
  app.init();
})(chrome);
{'fraction_non_alphanumeric': 0.14942728219368276, 'fraction_numerical': 0.0038181187087816732, 'mean_word_length': 2.3370005790387958, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '4476012', 'n_tokens_mistral': 1810, 'n_tokens_neox': 1696, 'n_words': 429}