1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-10 00:12:09 +00:00

Use Flatpak Chromium headless

inb4 a bunch of people from the privsec community @ me for using flatpak
chromium:

Yes, the sandboxing is different, but I'm not using this as my
day-to-day browser. I'm using it headless for measurements and auditing.
I want a browser that behaves as close to upstream official Chromium
builds when doing Chromium measurements.

Take some deep breaths. Here, have a glass of water.
This commit is contained in:
Rohan Kumar 2023-11-10 10:02:33 -08:00
parent d1fd05e56e
commit 94a15855c9
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479

View file

@ -7,18 +7,18 @@ SCHEME=https://
URL ?= $(SCHEME)$(DOMAIN)$(PAGE_PATH)
# latest bleeding-edge chromium snapshot
CHROME_DIR = /home/rkumar/Downloads/gitclone/chromium/thorium/latest
CHROME_PATH = $(CHROME_DIR)/thorium
CHROMEDRIVER_PATH = $(CHROME_DIR)/chromedriver
CHROME_PATH = org.chrome.Chromium
CHROMEDRIVER_PATH = chromedriver
CHROME_PROFILE ?= /tmp/chrome-lighthouse
JS_FLAGS=''
# We enable experimental web platform features so the Document-Policy header is enforced
# #
CHROME_FLAGS += --headless --disable-extensions --no-default-browser-check --disable-client-side-phishing-detection --disable-component-update --disable-default-apps --disable-device-discovery-notifications --disable-domain-reliability --disable-background-timer-throttling --disable-breakpad --enable-blink-features=LayoutInstabilityAPI --enable-features=UseDnsHttpsSvcb,UseDnsHttpsSvcbAlpn --no-first-run --disable-background-networking --user-data-dir=$(CHROME_PROFILE) --enable-experimental-web-platform-features --enable-quic --origin-to-force-quic-on=seirdy.one:443
CHROME_FLAGS += --headless --disable-network-portal-notification --disable-client-side-phishing-protection --disable-gaia-services --disable-sync --no-vr-runtime --no-wifi --no-crash-upload --no-report-uload --disable-extensions --allow-browser-signin=false --no-default-browser-check --disable-client-side-phishing-detection --disable-component-update --disable-default-apps --disable-device-discovery-notifications --disable-domain-reliability --disable-fonts-googleapis-references --disable-field-trial-config --lang=en-US --disable-ntp-popular-sites --disable-offer-store-unmasked-wallet-cards --disable-office-editing-component-extension --disable-fine-grained-time-zone-detection --disable-background-timer-throttling --disable-breakpad --enable-blink-features=LayoutInstabilityAPI --enable-features=UseDnsHttpsSvcb,UseDnsHttpsSvcbAlpn,AsyncDns --no-first-run --disable-background-networking --user-data-dir=$(CHROME_PROFILE) --enable-experimental-web-platform-features --enable-quic --origin-to-force-quic-on=seirdy.one:443
CHROME_FLAGS_COMMA = 'disable-extensions,no-default-browser-check,disable-client-side-phishing-detection,disable-component-update,disable-default-apps,disable-device-discovery-notifications,disable-domain-reliability,disable-background-timer-throttling,disable-breakpad,no-first-run,disable-background-networking,js-flags=--jitless'
# When quiet, my lappie's CPU power is benchmarked to be ~1320. The CPU throttling calculator recommends throttling by 3.1x.
# Multiply that by 4 cuz imo it's way too generous. It targets devices like the Moto G4; I target devices like the JioPhone 2.
CPU_SLOWDOWN=12.5
LIGHTHOUSE_ARGS += --budget-path linter-configs/budget.json --output html --output json --output-file lighthouse-results --throttling-method=devtools --throttling.cpuSlowdownMultiplier=$(CPU_SLOWDOWN) --chrome-flags="$(CHROME_FLAGS)"
# When quiet, my lappie's CPU power is benchmarked to be a bit under 1000. The CPU throttling calculator recommends throttling by 2.3.
# Multiply that by 3 cuz imo it's way too generous. It targets devices like the Moto G4; I target devices like the JioPhone 2.
CPU_SLOWDOWN=6.9 # nice
LIGHTHOUSE_ARGS += --budget-path linter-configs/budget.json --output html --output json --output-file lighthouse-results --throttling-method=devtools --throttling.cpuSlowdownMultiplier=$(CPU_SLOWDOWN) --chrome-flags="$(CHROME_FLAGS)" --view
# make some of these quiet bc they'll otherwise echo every URL