diff --git a/Utils.ts b/Utils.ts index 506cfd9ff4..bcf87a250e 100644 --- a/Utils.ts +++ b/Utils.ts @@ -301,7 +301,7 @@ export class Utils { * @param contents * @param fileName */ - public static downloadTxtFile(contents: string, fileName: string = "download.txt") { + public static offerContentsAsDownloadableFile(contents: string, fileName: string = "download.txt") { const element = document.createElement("a"); const file = new Blob([contents], {type: 'text/plain'}); element.href = URL.createObjectURL(file); diff --git a/preferences.ts b/preferences.ts index 9a98e80594..7f390c7976 100644 --- a/preferences.ts +++ b/preferences.ts @@ -89,7 +89,7 @@ function clearAll(preferences){ function SalvageButton(theme: { themeName: string, contents: string }) { return new SubtleButton("./assets/svg/bug.svg", "Download broken theme " + theme.themeName).onClick( () => { - Utils.downloadTxtFile(theme.contents, theme.themeName + ".json") + Utils.offerContentsAsDownloadableFile(theme.contents, theme.themeName + ".json") } ) }