<commit_before>#!/usr/bin/env bash

CHROME_ARGS=$@

launch_osx() {
  CHROME_CANARY_PATH="/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary"
  if [ ! -f "$CHROME_CANARY_PATH" ]; then
    echo "You must install Google Chrome Canary to use lighthouse"
    echo "You can download it from https://www.google.com/chrome/browser/canary.html"
    exit 1
  fi
  "$CHROME_CANARY_PATH" \
    --remote-debugging-port=9222 \
    --no-first-run \
    --enable-gpu-benchmarking \
    --user-data-dir="/tmp/lighthouse-profile" \
    $CHROME_ARGS \ 
    "about:blank"
}

launch_linux() {
  if [[ x"$LIGHTHOUSE_CHROMIUM_PATH" == x ]]; then
    echo "The environment variable LIGHTHOUSE_CHROMIUM_PATH must be set to executable of a build of Chromium version 51.0 or later."
    echo "If you do not have a recent build of chromium, you can get one from https://download-chromium.appspot.com/"
    exit 1
  fi

  echo "Launching Google Chrome from $LIGHTHOUSE_CHROMIUM_PATH"
  "$LIGHTHOUSE_CHROMIUM_PATH" \
    --remote-debugging-port=9222 \
    --no-first-run \
    --enable-gpu-benchmarking \
    --user-data-dir="/tmp/lighthouse-profile" \
    $CHROME_ARGS \
    "about:blank"
}

<commit_msg>Launch Chrome Canary found from the lsregistry dump<commit_after>#!/usr/bin/env bash

CHROME_ARGS=$@

launch_osx() {
  LSREGISTER=/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister
  CHROME_CANARY_APPDIR=$($LSREGISTER -dump | grep -i "google chrome canary.app$" | awk '{$1=""; print $0}' | xargs)
  CHROME_CANARY_PATH="${CHROME_CANARY_APPDIR}/Contents/MacOS/Google Chrome Canary"
  if [ ! -f "$CHROME_CANARY_PATH" ]; then
    echo "You must install Google Chrome Canary to use lighthouse"
    echo "You can download it from https://www.google.com/chrome/browser/canary.html"
    exit 1
  fi
  "$CHROME_CANARY_PATH" \
    --remote-debugging-port=9222 \
    --no-first-run \
    --enable-gpu-benchmarking \
    --user-data-dir="/tmp/lighthouse-profile" \
    $CHROME_ARGS \
    "about:blank"
}

launch_linux() {
  if [[ x"$LIGHTHOUSE_CHROMIUM_PATH" == x ]]; then
    echo "The environment variable LIGHTHOUSE_CHROMIUM_PATH must be set to executable of a build of Chromium version 51.0 or later."
    echo "If you do not have a recent build of chromium, you can get one from https://download-chromium.appspot.com/"
    exit 1
  fi

  echo "Launching Google Chrome from $LIGHTHOUSE_CHROMIUM_PATH"
  "$LIGHTHOUSE_CHROMIUM_PATH" \
    --remote-debugging-port=9222 \
    --no-first-run \
    --enable-gpu-benchmarking \
    --user-data-dir="/tmp/lighthouse-profile" \
    $CHROME_ARGS \
    "about:blank"
}


{'fraction_non_alphanumeric': 0.12518684603886399, 'fraction_numerical': 0.01046337817638266, 'mean_word_length': 3.3387358184764993, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4691726', 'n_tokens_mistral': 1004, 'n_tokens_neox': 961, 'n_words': 212}