From 373edf883dadea60977237fabfcc5292441031d9 Mon Sep 17 00:00:00 2001 From: Michael C Date: Fri, 1 Jul 2022 02:07:54 -0400 Subject: [PATCH] append timestamp to export filename --- src/options.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/options.ts b/src/options.ts index 8d074e38..49dce39f 100644 --- a/src/options.ts +++ b/src/options.ts @@ -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();