<commit_before><!DOCTYPE HTML>
<html>
<head>
   <title>global page</title>
   <script type="text/javascript">
 
  var disabledSites = safari.extension.settings.disabledsites;
  
  String.prototype.trim = function () {
      return this.replace(/^\s*/, "").replace(/\s*$/, "");
  }
  
  function disabledSitesHandler() {
    console.log(disabledSites);
    if (disabledSites != undefined) {
      disabledSitesArray = disabledSites.split(",");

      for (var i=0; i < disabledSitesArray.length; i++) {
        var ds = disabledSitesArray[i].trim();
        currentSite = safari.application.activeBrowserWindow.activeTab.url;
        if (ds.match(/([^\/.]+\.[^\/.]+(?=$|\/))/)[0] == currentSite.match(/([^\/.]+\.[^\/.]+(?=$|\/))/)[0]) {
          safari.application.activeBrowserWindow.activeTab.page.dispatchMessage("disable",true);
          return;
        }
      }
      safari.application.activeBrowserWindow.activeTab.page.dispatchMessage("load",true);
    } else {
      safari.application.activeBrowserWindow.activeTab.page.dispatchMessage("load",true);
    }
  }

  function disabledSitesChanged(event) {
    if (event.key == "disabledsites") {
      disabledSites=event.newValue;
      disabledSitesHandler();
    }
  }
   
  safari.extension.settings.addEventListener("change", disabledSitesChanged, false);<commit_msg>A fix for domain names that does not contain a . like local pages (ie localhost)<commit_after><!DOCTYPE HTML>
<html>
<head>
   <title>global page</title>
   <script type="text/javascript">
 
  var disabledSites = safari.extension.settings.disabledsites;
  
  String.prototype.trim = function () {
      return this.replace(/^\s*/, "").replace(/\s*$/, "");
  }
  
  function disabledSitesHandler() {
    if (disabledSites != undefined) {
      disabledSitesArray = disabledSites.split(",");

      for (var i=0; i < disabledSitesArray.length; i++) {
        var ds = disabledSitesArray[i].trim();
        currentSite = safari.application.activeBrowserWindow.activeTab.url;
        dsm = ds.match(/([^\/.]+\.[^\/.]+(?=$|\/))/);
        csm = currentSite.match(/([^\/.]+\.[^\/.]+(?=$|\/))/);
        if (dsm != null && csm != null && dsm[0] == csm[0]) {
          safari.application.activeBrowserWindow.activeTab.page.dispatchMessage("disable",true);
          return;
        }
      }
      safari.application.activeBrowserWindow.activeTab.page.dispatchMessage("load",true);
    } else {
      safari.application.activeBrowserWindow.activeTab.page.dispatchMessage("load",true);
    }
  }

  function disabledSitesChanged(event) {
    if (event.key == "disabledsites") {
      disabledSites=event.newValue;
      disabledSitesHandler();
    }
  }
   
  safari.extension.settings.addEventListener("change", disabledSitesChanged, false);
{'fraction_non_alphanumeric': 0.1769815418023887, 'fraction_numerical': 0.002171552660152009, 'mean_word_length': 3.207001522070015, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, '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': '178875', 'n_tokens_mistral': 865, 'n_tokens_neox': 858, 'n_words': 126}