0

I'm trying to create a Google Chrome extension, where users can "enable" certain backgrounds, returning an image and making that into the background of Google's homepage. I want the end result to be something that Image 1 below.

Optimal End Result

How can one do this using only pure JavaScript? So far this is all I have been able to create so far:

const checkbox = document.getElementById("checkbox");

checkbox.addEventListener("change", () => {
    window.location.href = "https://www.google.ca/";
    window.body.style.backgroundImage = "url('12.png')";
    window.body.style.backgroundRepeat = "no-repeat";
    window.body.style.backgroundSize = "cover";
});

Right now, all I want to be able to create is something where, if I check the checkbox, a image I have locally saved appears as the background of Google, and locally stores it to always be that way until I uncheck the checkbox. Any help is appreciated.

Ri3habh
  • 3
  • 1

0 Answers0