mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-09-22 17:16:19 -07:00
- Add backend selection, setup gating, Anki integration, and external host support - Add launcher flags, documentation, packaging, and focused tests - Open on-demand overlay modals on the first attempt
16 lines
468 B
JavaScript
16 lines
468 B
JavaScript
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
export function downloadBlob(document, blob, filename) {
|
|
const window = document.defaultView;
|
|
const url = window.URL.createObjectURL(blob);
|
|
try {
|
|
const anchor = document.createElement("a");
|
|
anchor.href = url;
|
|
anchor.download = filename;
|
|
anchor.click();
|
|
} catch (error) {
|
|
window.URL.revokeObjectURL(url);
|
|
throw error;
|
|
}
|
|
window.setTimeout(() => window.URL.revokeObjectURL(url), 60_000);
|
|
}
|