Files
kget-capture/extension/popup.js
T
andwati 235c377361 Fix Chrome save-as prompt and unreliable finish notifications
Chrome's own "Ask where to save each file" setting shows a native
picker before the extension can ever intercept the download, and no
extension API can read or suppress it -- surface this clearly in
install.sh, the README, and a popup shortcut instead of leaving it
buried as a footnote.

Also fixes silently missing "download complete" notifications: KGet
only fires its own finished-notification if a transfer was observed
in a non-finished state at least once, so small/fast downloads that
complete before that first observation never get one. The native
host now drives its own notification via notify-send, polling actual
transfer progress instead of relying on KGet's internal check, and
install.sh disables KGet's own notification to avoid duplicates.
2026-08-12 11:33:46 +03:00

21 lines
706 B
JavaScript

const checkbox = document.getElementById("auto-capture-toggle");
const statusLine = document.getElementById("status-line");
function renderStatus(enabled) {
statusLine.textContent = `Auto-capture: ${enabled ? "ON" : "OFF"}`;
}
chrome.storage.local.get({ autoCaptureEnabled: true }).then(({ autoCaptureEnabled }) => {
checkbox.checked = autoCaptureEnabled;
renderStatus(autoCaptureEnabled);
});
checkbox.addEventListener("change", () => {
chrome.storage.local.set({ autoCaptureEnabled: checkbox.checked });
renderStatus(checkbox.checked);
});
document.getElementById("open-download-settings").addEventListener("click", () => {
chrome.tabs.create({ url: "chrome://settings/downloads" });
});