function installPreCopier() {
  var body = document.getElementsByTagName("body");
  body[0].insertAdjacentHTML("afterbegin",
    "<div class='toast' style='position:fixed; background:#DDD; left: 40%; top:10px;'><div class='toast-body'>Content copied to the clipboard</div></div>"
  );

  const copyToClipboard = str => {
    const el = document.createElement('textarea');
    el.value = str;
    document.body.appendChild(el);
    el.select();
    document.execCommand('copy');
    document.body.removeChild(el);
  }

  var list = document.querySelectorAll('pre');

  list.forEach(function (userItem) {
    userItem.addEventListener('click', function (ev) {
      copyToClipboard(ev.target.innerText);
      $('.toast').toast('show');
    }, false);
  });
};
