Paullitsch / SelectAll - Boom

// ==UserScript==
// @name         SelectAll - Boom
// @namespace    http://tampermonkey.net/
// @version      1
// @description  try to take over the world!
// @author       Paul Bobik @Paullitsch
// @copyright    2019, Paullitsch (https://openuserjs.org//users/Paullitsch)
// @license      MIT
// @match        http://support.boomsoftware.com/view_all_bug_page.php*
// @grant        none
// ==/UserScript==

(function () {
  'use strict';

  var exportButton = document.getElementsByName("f_csv")[0];

  var selectAllButton = document.createElement("input");
  selectAllButton.type = "submit";
  selectAllButton.name = "f_selectAll";
  selectAllButton.value = "alle markieren";

  exportButton.parentNode.insertBefore(selectAllButton, exportButton.nextSibling);

  selectAllButton.addEventListener("click", () => {
    var cbks = document.getElementsByName("f_bug_arr[]");
    for (var cb of cbks) {
      cb.checked = !cb.checked;
    }
  });
})();