Grammalecte  Artifact [7e16bf9b14]

Artifact 7e16bf9b1497b0d3bb753753a2cc6dee6c6801031622ecdefb1933794f5e107d:



function do_something (request, sender, sendResponse) {
  //removeEverything();
  change(request.myparam);
  console.log("DONE!!");
  browser.runtime.onMessage.removeListener(do_something);
}

function removeEverything () {
  while (document.body.firstChild) {
    document.body.firstChild.remove();
  }
}

function change (param) {
  document.getElementById("title").setAttribute("background-color", "#809060");
  console.log("param: " + param);
  document.getElementById("title").setAttribute("background-color", "#FF0000");
}


/*
  Assign do_something() as a listener for messages from the extension.
*/
browser.runtime.onMessage.addListener(do_something);