Skip to content

anbeime/skill / skills/chrome-automation/chrome-automation

chrome-automation

Flagged

网页开发工程师与运营专员在需要自动化现有 Chrome 浏览器时必用!通过 CDP 协议无缝接管当前浏览器,自动配置环境并实时可视化执行任务。完美保留登录状态,一键完成复杂网页自动化流程,让繁琐操作自动化。

scripts/start-chrome-mac.sh

View on GitHub
#!/bin/bash
# Chrome startup script with persistent profile support
# This script starts Chrome with a dedicated automation profile that preserves login states

set -e

# Define paths
CHROME_AUTOMATION_DIR="$HOME/Library/Application Support/Google/Chrome-Automation"
CHROME_DEFAULT_DIR="$HOME/Library/Application Support/Google/Chrome"
CHROME_APP="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
DEBUG_PORT=9222

echo "🔍 Checking Chrome automation profile..."

# Check if Chrome is already running with debug port
if ps aux | grep -v grep | grep "remote-debugging-port=$DEBUG_PORT" > /dev/null; then
    echo "✓ Chrome is already running with debug port $DEBUG_PORT"
    exit 0
fi

# Check if dedicated automation directory exists
if [ ! -d "$CHROME_AUTOMATION_DIR" ]; then
    echo "📦 First time setup: Creating dedicated Chrome automation profile..."

    # Create the automation directory
    mkdir -p "$CHROME_AUTOMATION_DIR"

    # Check if default Chrome profile exists
    if [ -d "$CHROME_DEFAULT_DIR/Default" ]; then
        echo "📋 Importing configuration from your existing Chrome profile..."
        echo "   (This includes your login states, cookies, and settings)"

        # Copy the Default profile, excluding large cache files
        rsync -av --progress \
            --exclude='Cache' \
            --exclude='Code Cache' \
            --exclude='GPUCache' \
            --exclude='Service Worker' \
            --exclude='ShaderCache' \
            --exclude='GrShaderCache' \
            --exclude='component_crx_cache' \
            --exclude='BrowserMetrics' \
            --exclude='CertificateRevocation' \
            --exclude='Crashpad' \
            --exclude='FileTypePolicies' \
            --exclude='OptimizationGuidePredictionModels' \
            --exclude='SafetyTips' \
            --exclude='SSLErrorAssistant' \
            --exclude='Subresource Filter' \
            --exclude='ZxcvbnData' \
            "$CHROME_DEFAULT_DIR/Default/" \
            "$CHROME_AUTOMATION_DIR/Default/"

        # Also copy Local State file for profile settings
        if [ -f "$CHROME_DEFAULT_DIR/Local State" ]; then
            cp "$CHROME_DEFAULT_DIR/Local State" "$CHROME_AUTOMATION_DIR/"
        fi

        echo "✓ Configuration imported successfully!"
    else
        echo "⚠️  No existing Chrome profile found. Starting with fresh profile."
        echo "   You'll need to log in manually on first use."
    fi
else
    echo "✓ Chrome automation profile found"
    echo "   Location: $CHROME_AUTOMATION_DIR"
fi

# Close any existing Chrome instances that might conflict
# (Optional: uncomment if you want to ensure clean start)
# pkill -f "Google Chrome" 2>/dev/null || true
# sleep 1

# Start Chrome with the dedicated automation profile
echo "🚀 Starting Chrome with automation profile..."
"$CHROME_APP" \
    --remote-debugging-port=$DEBUG_PORT \
    --user-data-dir="$CHROME_AUTOMATION_DIR" &

# Wait for Chrome to start
sleep 3

# Verify Chrome started successfully
if ps aux | grep -v grep | grep "remote-debugging-port=$DEBUG_PORT" > /dev/null; then
    echo "✓ Chrome started successfully with debug port $DEBUG_PORT"
    echo ""
    echo "📍 Profile location: $CHROME_AUTOMATION_DIR"
    echo "🔗 Debug port: $DEBUG_PORT"
    echo ""
    echo "Your login states and cookies are preserved in this profile."
    echo "You only need to log in once - it will be remembered for future sessions."
else
    echo "❌ Failed to start Chrome"
    exit 1
fi
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall