[MIRROR] Port of the iframe storage for settings (#12040)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-12-04 17:26:10 -07:00
committed by GitHub
parent 1b99ac2969
commit ba5019bd9d
12 changed files with 326 additions and 32 deletions

View File

@@ -29,6 +29,7 @@
// Expose inlined metadata
Byond.windowId = parseMetaTag('tgui:windowId');
Byond.storageCdn = parseMetaTag('tgui:storagecdn');
// Backwards compatibility
window.__windowId__ = Byond.windowId;
@@ -397,32 +398,17 @@
],
};
try {
window
.showSaveFilePicker(opts)
.then((fileHandle) => {
fileHandle
.createWritable()
.then((writeableFileHandle) => {
writeableFileHandle
.write(blob)
.then(() => {
writeableFileHandle.close();
})
.catch((e) => {
console.error(e);
});
})
.catch((e) => {
console.error(e);
});
})
.catch((e) => {
console.error(e);
window
.showSaveFilePicker(opts)
.then(function (file) {
return file.createWritable();
})
.then(function (file) {
return file.write(blob).then(function () {
return file.close();
});
} catch (e) {
console.error(e);
}
})
.catch(function () {});
}
};