testsAndMisc/docs/superpowers/evidence/ublock-origin-wrapper-integration-2026-08-12.json
Krzysztof kuhy Rudnicki 47371ac9a1
Some checks failed
Pre-commit checks / pre-commit (push) Has been cancelled
Python tests / test (push) Has been cancelled
Shell tests / shell-tests (push) Has been cancelled
Shell tests / arch-tests (push) Has been cancelled
Wire uBlock Origin into every real Chromium launch, alongside LeechBlock
install_ublock.sh patches the same wrapper install_leechblock.sh already
targets, always rewriting --load-extension into a single comma-joined
flag rather than appending a second occurrence — verified empirically
that Chromium is last-wins across separate --load-extension flags and
would otherwise silently drop LeechBlock.

seed_ublock_storage.js previously hardcoded uBlock Origin's Chrome Web
Store extension ID, but --load-extension (unpacked) loads get a
synthetic, install-path-derived ID instead. It now reads the real ID
back out of the profile's own Preferences file, with a --ext-path
override for installers whose package path differs from Arch's.

install_ungoogled_chromium_ubuntu.sh's UBLOCK_EXT_PATH was an unverified
guess (/usr/share/webext/ublock-origin-chromium); corrected to the real
Debian/Ubuntu package path confirmed via packages.ubuntu.com.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015yfDYbaw1D1WhVMqWhsSDA
2026-08-12 22:44:28 +02:00

57 lines
5.4 KiB
JSON

{
"intent": "Make full/classic uBlock Origin load on every real Chromium-family browser launch on Arch (alongside LeechBlockNG, already wired by install_leechblock.sh), and fix the same integration for the Ubuntu/Debian install script so both distros work end to end.",
"scope": [
"linux_configuration/scripts/periodic_background/digital_wellbeing/install_ublock.sh (new)",
"linux_configuration/scripts/periodic_background/digital_wellbeing/seed_ublock_storage.js",
"linux_configuration/scripts/single_use/install_ungoogled_chromium_ubuntu.sh",
"Non-goal: no changes to LeechBlockNG's own installer or defaults"
],
"changes": [
"seed_ublock_storage.js: fixed extension-ID discovery for --load-extension (unpacked) deployments. Chromium assigns a synthetic, install-path-derived ID rather than the CWS ID for unpacked loads; the seeder now reads extensions.settings[*].path back out of the profile's own Preferences file to find the right LevelDB storage dir, falling back to the CWS ID only for real Chrome-Web-Store installs. Verified empirically: /usr/lib/ublock-origin resolves to id bnpeoafekllpappgoakfpagjghdaicfb on this machine.",
"seed_ublock_storage.js: added --ext-path=<path> CLI override so non-Arch installers (different package path) can point the ID-discovery step at their own unpacked install location instead of relying on a hardcoded Arch path.",
"install_ublock.sh (new): wires uBlock Origin into the same Chromium-family wrapper install_leechblock.sh already patches, using a comma-joined single --load-extension flag rather than a second, separate flag occurrence.",
"install_ungoogled_chromium_ubuntu.sh: corrected UBLOCK_EXT_PATH from the unverified guess /usr/share/webext/ublock-origin-chromium to the actual Debian/Ubuntu package path /usr/share/chromium/extensions/ublock-origin, confirmed via packages.ubuntu.com's noble file listing for webext-ublock-origin-chromium (manifest.json present at that path). Also passes --ext-path to the seeder so ID discovery works on Ubuntu too."
],
"verification": [
{
"command": "Empirical: launched real /usr/bin/chromium headless with --load-extension=/usr/lib/ublock-origin, inspected Preferences",
"result": "pass",
"evidence": "extensions.settings['bnpeoafekllpappgoakfpagjghdaicfb'].path == '/usr/lib/ublock-origin', confirming the synthetic-ID mechanism the seeder fix relies on"
},
{
"command": "Empirical: tested a single comma-joined --load-extension=pathA,pathB flag vs. two separate --load-extension= flags",
"result": "pass / critical finding",
"evidence": "Comma-joined: both extensions register with disable_reasons: []. Two separate flags: LAST-WINS, the first extension is silently dropped. install_ublock.sh and the Ubuntu script were written to always comma-join into any existing flag rather than append a second one."
},
{
"command": "node ./seed_ublock_storage.js --force run against a scratch profile pre-seeded via a real headless chromium launch",
"result": "pass",
"evidence": "Correctly discovered synthetic ID from Preferences, wrote selectedFilterLists (71 entries) to the matching LevelDB dir; read back and confirmed persisted"
},
{
"command": "node ./seed_ublock_storage.js --ext-path=/usr/share/chromium/extensions/ublock-origin --force run against a synthetic Preferences entry using the Debian path",
"result": "pass",
"evidence": "Correctly matched the override path and seeded the corresponding LevelDB dir, confirming the Ubuntu installer's fixed invocation will work"
},
{
"command": "bash install_ublock.sh run for real against the live system (user-approved)",
"result": "pass",
"evidence": "Patched /usr/local/bin/browser-preexec-wrapper's exec line to a comma-joined --load-extension flag; launched real chromium afterward and confirmed both bnpeoafekllpappgoakfpagjghdaicfb (uBO) and kbkikbljacklcgphimabcdnifabmhfjn (LeechBlock) present with disable_reasons: [] in the live profile's Preferences"
},
{
"command": "shellcheck install_ublock.sh scripts/single_use/install_ungoogled_chromium_ubuntu.sh && shfmt -d (both)",
"result": "pass",
"evidence": "shellcheck exit 0 for both; shfmt reported no diff for either file"
}
],
"risks": [
"install_ublock.sh's idempotency check greps for the uBO path already present inside a --load-extension=\"...\" flag; if a future manual edit changes flag quoting style it could double-patch on re-run (mitigated: it also backs up to .orig before any patch, same pattern as install_leechblock.sh)",
"UBLOCK_EXT_PATH for Ubuntu is now sourced from a live packages.ubuntu.com listing rather than execution on real Ubuntu hardware — the Ubuntu install script itself (download/apt install steps) remains unexecuted/unverified on this session, only the seeder+path logic was verified",
"The deployed /usr/local/bin/browser-preexec-wrapper is a stale (pre-crash-logging) revision vs. the repo's current system-maintenance/bin/browser-preexec-wrapper.sh source — install_ublock.sh patched the deployed file as-is; the crash-logging feature drift is a separate, unaddressed issue"
],
"rollback": [
"git revert this commit",
"On the live machine: restore /usr/local/bin/browser-preexec-wrapper from /usr/local/bin/browser-preexec-wrapper.orig (sudo cp -a) to undo the real system patch made this session"
]
}