function saveOptions(e) {
  browser.storage.local.set({
    colour: document.querySelector("#colour").value
  });
}

function restoreOptions() {
  var gettingItem = browser.storage.local.get('colour');
  gettingItem.then((res) => {
    document.querySelector("#colour").value = res.colour || 'Firefox red';
  });
}

document.addEventListener('DOMContentLoaded', restoreOptions);
document.querySelector("form").addEventListener("submit", saveOptions);

function saveOptions(e) {
  browser.storage.local.set({
    colour: document.querySelector("#colour").value
  });
  e.preventDefault();
}

function restoreOptions() {
  var gettingItem = browser.storage.local.get('colour');
  gettingItem.then((res) => {
    document.querySelector("#colour").value = res.colour || 'Firefox red';
  });
}

document.addEventListener('DOMContentLoaded', restoreOptions);
document.querySelector("form").addEventListener("submit", saveOptions);

add in prevent default (#173)