mirror of
https://github.com/andwati/kget-capture.git
synced 2026-10-27 23:42:18 +00:00
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.
21 lines
706 B
JavaScript
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" });
|
|
});
|