Added date and time to the settings export file

Fixes #352
This commit is contained in:
kkapsner 2019-05-28 23:59:43 +02:00
parent 036c7cdbd0
commit b7d888dee1
2 changed files with 15 additions and 3 deletions

View File

@ -51,7 +51,19 @@
const link = document.createElement("a");
link.href = window.URL.createObjectURL(blob);
link.target = "_blank";
link.download = "CanvasBlocker-settings.json";
const now = new Date();
function format(number, digits){
var str = number.toFixed(0);
return "0".repeat(digits - str.length) + str;
}
link.download = "CanvasBlocker-settings_" +
format(now.getFullYear(), 4) + "-" +
format(now.getMonth() + 1, 2) + "-" +
format(now.getDate(), 2) + "_" +
format(now.getHours(), 2) + "-" +
format(now.getMinutes(), 2) + "-" +
format(now.getSeconds(), 2) +
".json";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);

View File

@ -3,10 +3,10 @@ Version 0.5.10:
- min version is now 57 to remove the amount of warnings on submission
new features:
-
- added date and time to the settings export file
fixes:
-
- setter for innerHTML broke pages
known issues:
- if a data URL is blocked the page action button does not appear