Files
qwen-code/packages/chrome-qwen-bridge/set-extension-id.sh
2025-12-20 00:58:41 +08:00

24 lines
640 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
echo "🔧 配置 Native Host 使用特定扩展 ID..."
EXTENSION_ID="cimaabkejokbhjkdnajgfniiolfjgbhd"
CONFIG_FILE="$HOME/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.qwen.cli.bridge.json"
RUN_SCRIPT="$PWD/native-host/run.sh"
# 创建配置(使用特定扩展 ID
cat > "$CONFIG_FILE" <<EOF
{
"name": "com.qwen.cli.bridge",
"description": "Native messaging host for Qwen CLI Bridge",
"path": "$RUN_SCRIPT",
"type": "stdio",
"allowed_origins": [
"chrome-extension://$EXTENSION_ID/"
]
}
EOF
echo "✅ 配置已更新(仅允许扩展 ID: $EXTENSION_ID"
echo ""
cat "$CONFIG_FILE"