<commit_before>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
{
  if (window.location.host === 'perf-html.io') {
    // Unregister service workers, and redirect. This can't be done with a 301 redirect
    // because the service worker will only show the old page.
    (async () => {
      const { serviceWorker } = navigator;
      if (serviceWorker) {
        // Remove the service worker.
        const registrations = await serviceWorker.getRegistrations();
        for (const registration of registrations) {
          registration.unregister();
        }
      }
      if (window.location.pathname.split('/')[0] !== 'from-addon') {
        // This "from-addon" check can be removed after Bug 1525358 lands, and there has
        // been a reasonable amount of time for folks to upgrade their Gecko Profiler
        // Add-on.

        const url = new URL('https://profiler.firefox.com')
        url.pathname = window.location.pathname
        url.search = window.location.search

        // Redirect on everything except "from-addon" which can cause breakage.
        window.location.replace(url.href);
      }
    })();
  }

  // Register the analytics.
  const doNotTrack =
    (navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack) === '1';

  if(!doNotTrack && window.location.host.includes('profiler.firefox.com')) {
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
    // If changing this tracker ID, update it in the end user docs as well.<commit_msg>Fix the index for the location pathname check in redirect<commit_after>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
{
  if (window.location.host === 'perf-html.io') {
    // Unregister service workers, and redirect. This can't be done with a 301 redirect
    // because the service worker will only show the old page.
    (async () => {
      const { serviceWorker } = navigator;
      if (serviceWorker) {
        // Remove the service worker.
        const registrations = await serviceWorker.getRegistrations();
        for (const registration of registrations) {
          registration.unregister();
        }
      }
      if (window.location.pathname.split('/')[1] !== 'from-addon') {
        // This "from-addon" check can be removed after Bug 1525358 lands, and there has
        // been a reasonable amount of time for folks to upgrade their Gecko Profiler
        // Add-on.

        const url = new URL('https://profiler.firefox.com')
        url.pathname = window.location.pathname
        url.search = window.location.search

        // Redirect on everything except "from-addon" which can cause breakage.
        window.location.replace(url.href);
      }
    })();
  }

  // Register the analytics.
  const doNotTrack =
    (navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack) === '1';

  if(!doNotTrack && window.location.host.includes('profiler.firefox.com')) {
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
    // If changing this tracker ID, update it in the end user docs as well.
{'fraction_non_alphanumeric': 0.14300411522633744, 'fraction_numerical': 0.00977366255144033, 'mean_word_length': 3.009278350515464, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, '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': '1024761', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1183, 'n_words': 326}