diff --git a/src/js/commandline-lists.js b/src/js/commandline-lists.js index bd8edf35a..fb6b67231 100644 --- a/src/js/commandline-lists.js +++ b/src/js/commandline-lists.js @@ -1596,6 +1596,14 @@ export let defaultCommands = { Commandline.show(); }, }, + { + id: "changeCustomBackground", + display: "Change custom background...", + input: true, + exec: (input) => { + UpdateConfig.setCustomBackground(input); + }, + }, { id: "changeTheme", display: "Change theme...", diff --git a/src/js/config.js b/src/js/config.js index 1c9fb98eb..639a0214c 100644 --- a/src/js/config.js +++ b/src/js/config.js @@ -1349,6 +1349,7 @@ export function setCustomBackground(value, nosave) { if (value == null || value == undefined) { value = ""; } + value = value.trim(); if( /(https|http):\/\/(www\.|).+\..+\/.+(\.png|\.gif|\.jpeg|\.jpg)/gi.test(value) || value == ""){ config.customBackground = value; ThemeController.applyCustomBackground();