Refactor README for distro install docs, fix release archive

Trim intro fluff, add per-distro dependency install commands, and make
the Chrome Web Store the primary extension install path with unpacked
install demoted to a dev-only section. Also switch the release workflow
to archive the whole repo instead of just extension/, since install.sh
and native-host/ are now what the README points users at downloading.
This commit is contained in:
2026-08-12 14:50:12 +03:00
parent 6ed564f802
commit 6ef2133760
2 changed files with 96 additions and 79 deletions
+6 -4
View File
@@ -15,10 +15,12 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Package extension - name: Package source
run: | # Users need the whole repo (install.sh, native-host/, keys/), not
cd extension # just extension/ -- the extension itself now ships via the Chrome
zip -r "../kget-capture-${GITHUB_REF_NAME}.zip" . # Web Store. git archive only includes tracked files, so the
# gitignored private key (never committed) can't end up in it.
run: git archive --format=zip -o "kget-capture-${GITHUB_REF_NAME}.zip" HEAD
- name: Create release - name: Create release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
+90 -75
View File
@@ -1,56 +1,84 @@
# KGet Capture # KGet Capture
A Chrome (and other Chromium-browser) extension that sends downloads to A Chromium browser extension that sends downloads to
[KGet](https://apps.kde.org/kget/), KDE's download manager, instead of (or in [KGet](https://apps.kde.org/kget/), KDE's download manager, instead of the
addition to) the browser's built-in downloader. browser's built-in downloader.
- Right-click any link, image, video, or audio element and choose - Right-click a link/image/video/audio and choose **"Download with KGet"**.
**"Download with KGet"** to send it straight to KGet — it starts - Or toggle **auto-capture** from the toolbar so every download is handed off
downloading immediately into your Downloads folder, no dialog. automatically, with the correct filename.
- A toolbar toggle enables **auto-capture**: while on, every download Chrome - A desktop notification fires when a capture finishes downloading.
starts is cancelled and handed off to KGet the same way, automatically,
with the correct filename (resolved by Chrome itself, so it's right even
for URLs whose path is just an opaque ID). Defaults to ON.
- A "Download complete" desktop notification appears once a capture actually
finishes downloading. This is driven by the extension itself (not KGet's
own per-transfer notification, which KGet silently skips for downloads
that finish very quickly — see Troubleshooting), so it fires reliably
regardless of file size or speed.
## Requirements ## Requirements
- Linux with KGet installed (and running, or set to autostart) - Linux with KGet installed and running (or set to autostart)
- One of: Google Chrome, Chromium, Brave, Vivaldi, Microsoft Edge - A Chromium-based browser: Chrome, Chromium, Brave, Vivaldi, or Edge
- `python3` and `dbus-send` on `PATH` (standard on virtually all Linux/KDE - `python3`, `dbus-send`
systems already) - `notify-send`, optional, for the completion notification
- `notify-send` (ships with most Linux desktops via libnotify) — optional, - `kwriteconfig6` (KDE Frameworks), optional, silences KGet's own duplicate
only used for the download-complete notification; captures still work notification
without it, just silently
- `kwriteconfig6` (ships with KDE Plasma) — optional, only used to disable Install everything on your distro:
KGet's own unreliable per-transfer notification so it doesn't double up
with the extension's; install still works without it **Fedora**
```bash
sudo dnf install kget python3 dbus-tools libnotify kf6-kconfig
```
**Arch / Manjaro**
```bash
sudo pacman -S kget python dbus libnotify kconfig
```
**Debian / Ubuntu / KDE neon**
```bash
sudo apt install kget python3 dbus-bin libnotify-bin kf6-kconfig-bin
```
**openSUSE**
```bash
sudo zypper install kget python3 dbus-1 libnotify-tools kconfig-tools
```
(`notify-send` and `kwriteconfig6` package names shift around between distro
versions. If a command above fails, drop that one package and search your
package manager for the binary name instead. Everything else still works
without them.)
## Install ## Install
1. Install the extension from the Chrome Web Store: **`<CHROME_WEB_STORE_URL>`**
*(placeholder, fill in once the listing is live)*.
2. Install the native messaging host that lets the extension talk to KGet.
Download and extract the latest release from the
[Releases page](https://github.com/andwati/kget-capture/releases), then
from inside that folder:
```bash
./install.sh
```
3. Open your browser's download settings (`chrome://settings/downloads`,
`brave://settings/downloads`, etc.) and turn **off** "Ask where to save
each file before downloading". Chrome shows this dialog itself, before the
extension gets a chance to intercept the download, so this one-time change
is required.
`install.sh` registers the native host for every supported browser it finds
installed and prints any remaining setup warnings.
### Building from source
Contributing, or want to run an unreleased version? Load the extension
unpacked instead of step 1 above:
```bash ```bash
git clone <this-repo-url> kget-capture git clone https://github.com/andwati/kget-capture.git
cd kget-capture cd kget-capture
./install.sh ./install.sh
``` ```
`install.sh` registers a native messaging host for every supported browser it Then in `chrome://extensions`: enable **Developer mode**, click **Load
finds installed, then prints the extension's fixed ID and next steps: unpacked**, and select this repo's `extension/` directory. `install.sh`
prints the extension's fixed ID so you can confirm it loaded correctly.
1. Open `chrome://extensions` (or your browser's equivalent).
2. Enable **Developer mode** (top-right toggle).
3. Click **Load unpacked** and select this repo's `extension/` directory.
4. Confirm the loaded extension's ID matches the one `install.sh` printed.
5. Open `chrome://settings/downloads` (or your browser's equivalent, e.g.
`brave://settings/downloads`, `edge://settings/downloads`) and turn **off**
"Ask where to save each file before downloading". Chrome shows this dialog
itself, before the extension ever gets a chance to intercept the download —
no extension API can read or suppress it, so this one-time setting change
is required for captures to work without an extra prompt.
## Usage ## Usage
@@ -64,44 +92,33 @@ finds installed, then prints the extension's fixed ID and next steps:
./uninstall.sh ./uninstall.sh
``` ```
This removes the native messaging host registrations and the installed host Removes the native messaging host registrations and installed host script.
script. You'll still need to remove the unpacked extension yourself via Remove the extension itself via `chrome://extensions` (or the Chrome Web
`chrome://extensions` — that step can't be scripted. Store listing); that step can't be scripted.
## Releases ## Releases
Pushing a tag matching `v*.*.*` (e.g. `v1.0.0`) triggers a GitHub Actions Prebuilt releases are published on the
workflow ([.github/workflows/release.yml](.github/workflows/release.yml)) [Releases page](https://github.com/andwati/kget-capture/releases); each
that zips `extension/` and publishes it as a GitHub Release with `vX.Y.Z` tag push builds and publishes one automatically.
auto-generated release notes. Bump `"version"` in `extension/manifest.json`
before tagging so the packaged extension's version matches.
```bash
git tag v1.0.0
git push origin v1.0.0
```
## Known limitations ## Known limitations
- **`blob:`/`data:`/`file:`/`filesystem:` URLs can't be captured.** There's - **`blob:`/`data:`/`file:`/`filesystem:` URLs can't be captured.** There's
no real network URL to hand to KGet — this includes saving a page you no real network URL to hand to KGet, so these proceed normally through
navigated to directly via `file://` (Ctrl+S on it is still a "download" as Chrome.
far as Chrome is concerned) — so these downloads proceed normally through
Chrome (a console warning is logged in the extension's service worker).
- **Auto-capture has a brief head start.** Manifest V3 removed blocking - **Auto-capture has a brief head start.** Manifest V3 removed blocking
`webRequest`, so Chrome begins the download before the extension can cancel `webRequest`, so Chrome begins the download before the extension can cancel
it. A small/partial temp file may transiently appear before it's erased. it. A small/partial temp file may transiently appear before it's erased.
- **No editable dialog.** Captures start immediately with no chance to - **No editable dialog.** Captures start immediately with no chance to
rename the file or pick a different folder beforehand — rename/move it rename the file or pick a folder beforehand: KGet only skips its
afterward in KGet or your file manager if needed. This is intentional: KGet interactive dialog when given a destination path up front, so instant
only skips its interactive "New Download" dialog when given a real capture and an editable prompt are mutually exclusive.
destination path up front, so instant capture and an editable prompt are - **Chrome may still show its own "Save As" dialog** if you skipped step 3 of
mutually exclusive given KGet's D-Bus API. Install above.
- **Chrome may still show its own "Save As" dialog** if you skipped step 5 of - **KGet must already be running.** If it's not, captures fail silently;
Install above — see there for why and how to fix it. check the service worker console for the actual error (see
- **KGet must already be running.** If it's not, captures fail silently from Troubleshooting).
the user's perspective — check the service worker console for the actual
error (see Troubleshooting).
## Troubleshooting ## Troubleshooting
@@ -118,19 +135,17 @@ git push origin v1.0.0
``` ```
If this fails with `ServiceUnknown`, KGet isn't running. If this fails with `ServiceUnknown`, KGet isn't running.
- **Download-complete notification not showing?** Confirm `notify-send` is - **Download-complete notification not showing?** Confirm `notify-send` is
installed (`command -v notify-send`) — without it, `kget_capture_host.py` installed (`command -v notify-send`); without it, `kget_capture_host.py`
skips the notification entirely rather than erroring. Otherwise, check that skips the notification entirely rather than erroring. Otherwise, check that
the transfer actually reached 100%: `kget_capture_host.py` polls the transfer actually reached 100%: `kget_capture_host.py` polls
`org.kde.kget.transfer.percent` on the new transfer's D-Bus object path `org.kde.kget.transfer.percent` on the new transfer's D-Bus object path
(e.g. `/KGet/Transfers/9`, printed by the `addTransfer` call above) until it (e.g. `/KGet/Transfers/9`, printed by the `addTransfer` call above) until it
hits 100, so a stuck/erroring transfer never fires one. Note this hits 100, so a stuck/erroring transfer never fires one. This notification
notification is separate from KGet's own built-in "Download Finished" is separate from KGet's own built-in "Download Finished" event.
event — `install.sh` disables that one (`kwriteconfig6 --file knotifyrc `install.sh` disables that one because KGet only fires it for transfers it
--group "Event/kget/finished" --key Action None`) because KGet only fires observed in a non-finished state at least once, so it silently skips
it for transfers it observed in a non-finished state at least once, so it small/fast downloads that complete before that first observation.
silently skips small/fast downloads that complete before that first
observation.
## License ## License
MIT — see [LICENSE](LICENSE). MIT, see [LICENSE](LICENSE).