BigTSDMB / Hide SDMB Infractions

// ==UserScript==
// @name        Hide SDMB Infractions
// @namespace   BigTSDMB.hide-sdmb-infractions
// @include     http://boards.straightdope.com/sdmb/member.php*
// @include		http://boards.straightdope.com/sdmb/usercp.php
// @version     3
// @grant       none
// @run-at      document-start
// @updateURL   https://openuserjs.org/install/BigTSDMB/Hide_SDMB_Infractions.meta.js
// @downloadURL https://openuserjs.org/install/BigTSDMB/Hide_SDMB_Infractions.user.js
// @supportURL  https://openuserjs.org/scripts/BigTSDMB/Hide_SDMB_Infractions
// @homepageURL https://openuserjs.org/scripts/BigTSDMB/Hide_SDMB_Infractions
// @require     https://raw.githubusercontent.com/uzairfarooq/arrive/master/src/arrive.js
// ==/UserScript==

var style = document.createElement('style');
style.textContent = '#infractions_tab { display: none !important; }';
style.id = "hideInfractions"
if (document.head) {
  document.head.appendChild(style);
} else if (document.arrive) {
  document.arrive('head', { onceOnly: true }, () => document.head.appendChild(style));
} else {
  setTimeout( () => document.body.appendChild(style), 25);
}

if (document.arrive) {
  document.arrive('#collapseobj_usercp_infraction', { onceOnly: true }, el => {
    el.parentElement.style.display = 'none';
  })
} else {
  window.addEventListener('DOMContentLoaded', function () {
    var infractions = document.getElementById('collapseobj_usercp_infraction');
    if (infractions) infractions.parentElement.style.display = 'none';
    var infractionStyle = document.getElementById ('hideInfractions');
    if (!infractionsStyle) document.head.appendChild(style);
  });
}