I've spent countless hours grappling with this code, attempting to dynamically resize the background of HTML based on the browser window size using JavaScript. Here's what I have so far (I'm using Firefox for this):
GM_addStyle('body {background-image: url("chrome://browserbackgrounds/content/browserbackgrounds
/Generic/Backgrounds/wall.jpg")}');
var images = document.getElementsByTagName ("img");
var x=0;
while(x<images.length)
{
if(images[x].src == "https://www.google.com/images/nav_logo170.png")
{
images[x].src = "chrome://browserbackgrounds/content/browserbackgrounds/Generic/Backgrounds
/wall.jpg";
}
x=x+1;
}
Here is where I am facing a roadblock:
document.getElementById("gsr").style.MozBackgroundSize="Cover";
document.getElementById("gsr").style.WebkitBackgroundSize="Cover";
document.getElementById("gsr").style.OBackgroundSize="Cover";
document.getElementById("gsr").style.BackgroundSize="Cover";