So, what this option should do is let the user upload a file (an image) with <input id="background-image" type=file></input>
(this works) but how do I get the background image to stay when a user opens a new tab or closes the current tab.
Here is the JS that sets the background image:
document.getElementById('background-image').addEventListener('change', readURL, true);
function readURL(){
var file = document.getElementById("background-image").files[0];
var reader = new FileReader();
var readFile = reader.readAsDataURL(file);
reader.onloadend = function(){
document.getElementById("main-background-image").style.backgroundImage = "url(" + reader.result + ")";
}
if(file){
reader.readAsDataURL(file);
}else{
}
}
Again this sets the image for the current tab, as long as the user doesn't click away. Is it possible to keep the user's background image for future and other tabs ?