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; }