What Apostate changes
launch_persistent_context(DIR) keeps an account’s cookies and logins in a user data directory, the directory where Chromium keeps its storage. The first launch on a directory also stores a seed in DIR/apostate/identity, and every later launch presents the machine that seed selects. A site that remembers devices sees the same one at each sign-in. Each new directory draws its own seed, so two accounts do not present the same machine. Seeds and identity covers the identity file.
Set up
apostate fonts install windows is for Linux and macOS hosts (Fonts). The folder holds accounts.json, the registry, and accounts.py, which lists, opens, checks and backs up the accounts in it.
The registry
user_data_diris relative to the registry file.- The script passes
personaasfingerprint_platformon every launch. The identity file does not record the persona, so the registry does. localeandtimezonefix the account’s region, so it is the same on every launch whatever a GeoIP lookup would answer.proxy_envnames the environment variable that holds the account’s proxy URL, so the credential stays out of the file.nulllaunches without a proxy.
Open an account
open launches a browser on the account’s user data directory, reads the machine from a page, and compares it with the machine recorded at the last launch:
READ collects the User-Agent, platform, cores, memory, screen, WebGL renderer, languages and timezone.
Run it
List the accounts. No user data directory exists yet:947bfbe8d30a... and stored it in the user data directory. The second launch read it back and presented the same machine. --url opens a page other than the default https://example.com.
An account with a proxy variable does not open until you set the variable:
Check the registry
check fails when two accounts share a directory or when two directories hold the same seed. Two directories hold the same seed when you copy one account’s directory to start another:
profiles/qa-shared-login to profiles/client-b-store:
open and backup refuse to run while check reports a problem.
Back up an account
backup refuses while a browser has the directory open, because Chromium is still writing to it. To restore, unzip the archive into the account’s own directory. The restored directory presents the same machine, with the cookies from the time of the backup.
Rules for each account
- One directory per account. Two accounts in one directory share cookies and a machine, and a site can link them. Never copy one account’s directory to start another, because the copy carries the same identity file. Choose seeds has the same rule for seeds.
- One browser per directory at a time. A second launch on a directory that a browser has open fails with a
LaunchErrorthat saysFailed to create a ProcessSingleton for your profile directory. - A proxy per account. Give each account one sticky exit in its registry region, and keep the proxy URL in the account’s variable. With
localeandtimezoneset, the package skips its GeoIP lookup, so the registry values have to match the exit. Proxies covers sticky sessions. - Backups hold logins. A backup holds the account’s cookies. Store backups with the same care as the account’s password.
- Updates. A release that changes the catalogue tables can change part of a machine.
opencompares each launch with the last one and names what changed. Pin the package version and read the changelog before you upgrade. Updates and catalogue changes covers what can move. - Working in the window.
openruns headless. To sign in by hand, passheadless=Falsetolaunch_persistent_context()on a computer with a display.