Revoke 1-time object URLs

This commit is contained in:
Cohee 2024-05-22 01:36:38 +03:00
parent 255cd1310d
commit 0371bf4e9f
6 changed files with 6 additions and 0 deletions

View File

@ -9971,6 +9971,7 @@ jQuery(async function () {
a.setAttribute('download', filename);
document.body.appendChild(a);
a.click();
URL.revokeObjectURL(a.href);
document.body.removeChild(a);
}

View File

@ -357,6 +357,7 @@ export class SettingsUi {
a.download = `${this.currentQrSet.name}.json`;
a.click();
}
URL.revokeObjectURL(url);
}
selectQrSet(qrs) {

View File

@ -155,6 +155,7 @@ class EdgeTtsProvider {
const url = URL.createObjectURL(audio);
this.audioElement.src = url;
this.audioElement.play();
URL.revokeObjectURL(url);
}
/**

View File

@ -180,6 +180,7 @@ class NovelTtsProvider {
const url = URL.createObjectURL(audio);
this.audioElement.src = url;
this.audioElement.play();
URL.revokeObjectURL(url);
}
async* fetchTtsGeneration(inputText, voiceId) {

View File

@ -60,6 +60,7 @@ class SpeechT5TtsProvider {
const url = URL.createObjectURL(audio);
this.audioElement.src = url;
this.audioElement.play();
URL.revokeObjectURL(url);
}
async loadSettings(settings) {

View File

@ -139,6 +139,7 @@ export function download(content, fileName, contentType) {
a.href = URL.createObjectURL(file);
a.download = fileName;
a.click();
URL.revokeObjectURL(a.href);
}
/**