Skip to content

Instantly share code, notes, and snippets.

@chew-z
Last active August 30, 2022 07:29
Show Gist options
  • Save chew-z/0c6ffc26946bb49fd1a251ce95747def to your computer and use it in GitHub Desktop.
Save chew-z/0c6ffc26946bb49fd1a251ce95747def to your computer and use it in GitHub Desktop.
Notes on using Chrome on macOS

Chrome Notes

Privacy

--disable-sync

Disables syncing browser data to a Google Account.

--disable-sync-types

(ex. --disable-synctypes='Typed URLs, Bookmarks, Autofill Profiles')

--bwsi

Indicates that the browser is in "browse without sign-in" (Guest session) mode. Should completely disable extensions, sync and bookmarks.

--incognito

--disable-reading-from-canvas

Taints all elements, regardless of origin.

--disable-remote-fonts

Disables remote web font support. SVG font should always work whether this option is specified or not.

--disable-voice-input

--no-pings

Don't send hyperlink auditing pings

--disable-physical-keyboard-autocorrect

Disables suggestions while typing on a physical keyboard.

--disable-system-timezone-automatic-detection

--enable-scripts-require-action

Network

--no-proxy-server

--proxy-server

Uses a specified proxy server, overrides system settings. This switch only affects HTTP and HTTPS requests

--no-referrers

--explicitly-allowed-ports

Explicitly allows additional ports using a comma-separated list of port numbers.

--host-rules

Comma-separated list of rules that control how hostnames are mapped. For example: "MAP * 127.0.0.1" --> Forces all hostnames to be mapped to 127.0.0.1 "MAP *.google.com proxy" --> Forces all google.com subdomains to be resolved to "proxy". "MAP test.com [::1]:77 --> Forces "test.com" to resolve to IPv6 loopback. Will also force the port of the resulting socket address to be 77. "MAP * baz, EXCLUDE www.google.com" --> Remaps everything to "baz", except for "www.google.com". These mappings apply to the endpoint host in a net::URLRequest (the TCP connect and host resolver in a direct connection, and the CONNECT in an http proxy connection, and the endpoint host in a SOCKS proxy connection).

--connectivity-check-url

url for network connectivity checking. Default is "https://clients3.google.com/generate_204".

location /generate_204 { return 204; } in nginx

--log-net-log

--dns-log-details

Performance

--enable-fast-unload

Enable the fast unload controller, which speeds up tab/window close by running a tab's onunload js handler independently of the GUI

--enable-precache

Enables the proactive populating of the disk cache with Web resources that are likely to be needed in future page fetches

--disk-cache-dir

--disk-cache-size

--media-cache-size

--use-simple-cache-backend

--aggressive-cache-discard

--aggressive-tab-discard

--enable-media-suspend

Varia

--homedir

Try homedir="/tmp/fakeuser"

Defines user homedir. This defaults to primary user homedir.

--restore-last-session

--enable-spotlight-actions

--google-base-url

--google-url


Aplication which is able to open links and start Chromium

on run
	tell application "System Events"
		if not (exists (application process "Chromium")) then
			set url204 to "https://warriornl.darktech.org/generate_204" as string
			-- set proxy_url to "socks5://127.0.0.1:9050" as string


			do shell script "open -n -a 'Chromium' --args --incognito --disable-sync --disable-voice-input --disable-reading-from-canvas --disable-system-timezone-automatic-detection --connectivity-check-url=" & quoted form of url204 & " --disable-remote-fonts --no-referrers --disable-physical-keyboard-autocorrect --no-pings    --enable-fast-unload --enable-media-suspend --use-simple-cache-backend --aggressive-cache-discard --enable-offline-auto-reload-visible-only "
		end if
	end tell
end run

on open location theURL
	
	if application "Chromium" is not running then
		set url204 to "https://warriornl.darktech.org/generate_204" as string
		-- set proxy_url to "socks5://127.0.0.1:9050" as string


		do shell script "open -n -a 'Chromium' --args --incognito --disable-sync --disable-voice-input --disable-reading-from-canvas --disable-system-timezone-automatic-detection --connectivity-check-url=" & quoted form of url204 & " --disable-remote-fonts --no-referrers --disable-physical-keyboard-autocorrect --no-pings    --enable-fast-unload --enable-media-suspend --use-simple-cache-backend --aggressive-cache-discard --enable-offline-auto-reload-visible-only "
	end if
	
	tell application "Chromium"
		activate
		open location theURL
		activate
	end tell
	
end open location

add to Info.plist for registering as valid handler

<key>CFBundleURLTypes</key>
	<array>
		<dict>
			<key>CFBundleURLName</key>
			<string>HTTP URL</string>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>http</string>
				<string>https</string>
			</array>
		</dict>
	</array>

applescript connecting via Tor. Better then Tor Browser (especially when using ungoogled-chromium with sensible switches [see above] - webrtc is off by default in ungoogled-chromium, canvas, remote fonts, sync off)

	if application "Chromium" is not running then
		set url204 to "https://warriornl.darktech.org/generate_204" as string
		set proxy_url to "socks5://127.0.0.1:9050" as string

		do shell script "open -n -a 'Chromium' --args --incognito --disable-sync --disable-voice-input --disable-reading-from-canvas --disable-system-timezone-automatic-detection --connectivity-check-url=" & quoted form of url204 & " --disable-remote-fonts --no-referrers --disable-physical-keyboard-autocorrect --no-pings --enable-fast-unload --enable-media-suspend --use-simple-cache-backend --aggressive-cache-discard --enable-offline-auto-reload-visible-only --proxy-server=" & quoted form of proxy_url
	end if

open -n -a 'Chromium' --args --incognito --disable-sync --disable-voice-input --disable-reading-from-canvas --disable-system-timezone-automatic-detection --connectivity-check-url='https://warriornl.darktech.org/generate_204' --disable-remote-fonts --no-referrers --disable-physical-keyboard-autocorrect --no-pings    --enable-fast-unload --enable-media-suspend --use-simple-cache-backend --aggressive-cache-discard --enable-offline-auto-reload-visible-only 

open -n -a 'Chromium' --args --incognito --no-pings --no-referrers --disable-sync --disable-remote-fonts --disable-reading-from-canvas --enable-offline-auto-reload-visible-only --enable-fullscreen-tab-detaching --enable-media-suspend --enable-fast-unload --use-simple-cache-backend --aggressive-cache-discard 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment