mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 12:07:11 +03:00
append timestamp to export filename
This commit is contained in:
@@ -598,8 +598,9 @@ async function setTextOption(option: string, element: HTMLElement, value: string
|
||||
function downloadConfig() {
|
||||
const file = document.createElement("a");
|
||||
const jsonData = JSON.parse(JSON.stringify(Config.cachedSyncConfig));
|
||||
const dateTimeString = new Date().toJSON().replace("T", "_").replace(/:/g, ".").replace(/.\d+Z/g, "")
|
||||
file.setAttribute("href", "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(jsonData)));
|
||||
file.setAttribute("download", "SponsorBlockConfig.json");
|
||||
file.setAttribute("download", "SponsorBlockConfig_"+dateTimeString+".json");
|
||||
document.body.append(file);
|
||||
file.click();
|
||||
file.remove();
|
||||
|
||||
Reference in New Issue
Block a user