Skip to content

Instantly share code, notes, and snippets.

@jazzdan
Created June 3, 2024 18:38
Show Gist options
  • Select an option

  • Save jazzdan/f07ba64a7fd04ea4b47390e8849b09fd to your computer and use it in GitHub Desktop.

Select an option

Save jazzdan/f07ba64a7fd04ea4b47390e8849b09fd to your computer and use it in GitHub Desktop.

Revisions

  1. jazzdan created this gist Jun 3, 2024.
    26 changes: 26 additions & 0 deletions install-extension.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    #!/bin/bash

    url="https://chromewebstore.google.com/detail/magical-ai-writer-autofil/iibninhmiggehlcdolcilmhacighjamp"
    id=$(echo "$url" | sed -n 's/.*\/\([a-z]\{32\}\)$/\1/p')

    if [ -z "$id" ]; then
    echo "Invalid Chrome Web Store URL."
    exit 1
    fi

    file_path="$HOME/Downloads/${id}.crx"
    dest="$HOME/Downloads/${id}/"

    # Download the file
    curl -L -o "$file_path" "https://clients2.google.com/service/update2/crx?response=redirect&prodversion=125.0.6422.141&acceptformat=crx2,crx3&x=id%3D${id}%26uc"

    # Check if the file was downloaded successfully
    if [ -f "$file_path" ]; then
    # Extract the CRX file
    unzip -o "$file_path" -d "$dest" || true
    else
    echo "Failed to download the file."
    exit 1
    fi

    echo "Open replay-chromium, navigate to chrome://extensions, enable developer mode and click 'Load Unpacked'. Then open $dest"