From 4d93ad588f999a5ec0c83a755e1006b0f6742e95 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 27 Jul 2026 08:43:21 -0700 Subject: [PATCH] Register the Chromium native messaging hosts on fresh installs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Chromium ships in the base packages, so it never goes through omarchy-install-browser, and a first install stamps every migration as already applied without running it. That left both bundled extensions loaded from chromium-flags.conf with no host to talk to: Copy URL did nothing at all, since the clipboard write and the toast both live in the host. The user install now registers both hosts itself, and a migration repairs the installs that already missed out — Copy URL since 1784763917 landed, Download Video since 1780517689, unless installing a browser or refreshing Chromium happened to fix them along the way. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01VeAd2iERgi7bRSxq2gA1hp --- install/user/all.sh | 1 + install/user/chromium.sh | 6 ++++++ migrations/1785166747.sh | 6 ++++++ test/shell.d/chromium-copy-url-test.sh | 14 ++++++++++++++ 4 files changed, 27 insertions(+) create mode 100644 install/user/chromium.sh create mode 100644 migrations/1785166747.sh diff --git a/install/user/all.sh b/install/user/all.sh index 1da564d4..39d98ea5 100644 --- a/install/user/all.sh +++ b/install/user/all.sh @@ -1,4 +1,5 @@ run_logged "$OMARCHY_INSTALL/user/theme.sh" +run_logged "$OMARCHY_INSTALL/user/chromium.sh" run_logged "$OMARCHY_INSTALL/user/git.sh" run_logged "$OMARCHY_INSTALL/user/xcompose.sh" run_logged "$OMARCHY_INSTALL/user/mise-work.sh" diff --git a/install/user/chromium.sh b/install/user/chromium.sh new file mode 100644 index 00000000..a5b29adb --- /dev/null +++ b/install/user/chromium.sh @@ -0,0 +1,6 @@ +# Chromium ships in the base packages, so it never goes through +# omarchy-install-browser, and fresh installs mark every migration as already +# applied. Without this, the bundled extensions load but have no native +# messaging host to talk to. +omarchy-install-chromium-copy-url +omarchy-install-chromium-ytdlp diff --git a/migrations/1785166747.sh b/migrations/1785166747.sh new file mode 100644 index 00000000..3688e094 --- /dev/null +++ b/migrations/1785166747.sh @@ -0,0 +1,6 @@ +echo "Register the native messaging hosts for the bundled Chromium extensions" + +# Fresh installs stamped 1780517689 and 1784763917 as applied without running +# them, so the bundled extensions loaded with no host to talk to. +omarchy-install-chromium-copy-url +omarchy-install-chromium-ytdlp diff --git a/test/shell.d/chromium-copy-url-test.sh b/test/shell.d/chromium-copy-url-test.sh index 4b3fcbf0..85929946 100644 --- a/test/shell.d/chromium-copy-url-test.sh +++ b/test/shell.d/chromium-copy-url-test.sh @@ -69,6 +69,20 @@ jq -e --arg path "$ROOT/bin/omarchy-chromium-copy-url-host" ' ' "$native_manifest" >/dev/null || fail "copy-url native host manifest uses Omarchy host path and extension id" pass "copy-url native host installer registers the stable extension id" +# Chromium ships in the base packages, so it never goes through +# omarchy-install-browser, and a first install marks every migration as already +# applied. The user install has to register the host itself. +grep -q 'user/chromium.sh' "$ROOT/install/user/all.sh" || + fail "user install runs the Chromium native messaging host setup" + +fresh_home="$TMPDIR/fresh-install" +HOME="$fresh_home" OMARCHY_PATH="$ROOT" PATH="$ROOT/bin:$PATH" \ + bash -euo pipefail -c 'source "$ROOT/install/user/chromium.sh"' + +[[ -f $fresh_home/.config/chromium/NativeMessagingHosts/com.omarchy.copy_url.json ]] || + fail "fresh install registers the copy-url native messaging host" +pass "fresh install registers the copy-url native messaging host" + copied_url=$(bash -c ' source "$1" wl-copy() { cat; }