-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunch_chrome_with_proxy.sh
More file actions
42 lines (35 loc) · 1.33 KB
/
launch_chrome_with_proxy.sh
File metadata and controls
42 lines (35 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
# Launch Chrome with the Tor proxy
# This script launches a new instance of Google Chrome with a temporary user profile,
# and routes its traffic through the local Tor proxy.
# --- Configuration ---
# The address of the proxy
PROXY_ADDRESS="127.0.0.1:3128"
# The URL to open in the new Chrome window
TARGET_URL="https://check.torproject.org/"
# --- Script ---
mkdir -p /tmp/chrome_profile
# Create a temporary directory for the Chrome user profile.
# This ensures that the new Chrome instance doesn't interfere with your existing one.
PROFILE_DIR=/tmp/chrome_profile
# Launch Google Chrome with the specified proxy settings.
#
# --proxy-server: Specifies the proxy server to use for all traffic.
# Format: "http://<user>:<pass>@<address>"
#
# --user-data-dir: Specifies the directory to use for the user profile.
# This creates a new, temporary profile for this session.
#
# --no-first-run: Prevents the first-run welcome screen from appearing.
#
# --new-window: Opens a new Chrome window.
#
# <TARGET_URL>: The URL to open in the new window.
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--proxy-server="${PROXY_ADDRESS}" \
--user-data-dir="${PROFILE_DIR}" \
--no-first-run \
--new-window \
"${TARGET_URL}"
# Clean up the temporary profile directory when the script exits.
trap 'rm -rf "${PROFILE_DIR}"' EXIT