FBI UCR Tweaks

Tweaks to make the FBI's crime report site easier to use

  1. // ==UserScript==
  2. // @name FBI UCR Tweaks
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Tweaks to make the FBI's crime report site easier to use
  6. // @author Claire
  7. // @include https://ucr.fbi.gov/*
  8. // @grant GM_addStyle
  9. // ==/UserScript==
  10.  
  11. var newCSS = `
  12. .tblTxt {
  13. font-size: .8em;
  14. font-style: italic;
  15. color: #666;
  16. }
  17. `;
  18. GM_addStyle(newCSS);
  19.  
  20. links = document.getElementsByClassName("arrow-left-small");
  21. arr = [];
  22. Array.prototype.forEach.call(links, function(el, i){
  23. if(el.title.length > 0) {
  24. t = document.createElement("div");
  25. t.id = "tbl" + el.text.split(" ")[1];
  26. t.className = "tblTxt";
  27. t.innerHTML = el.title;
  28. el.parentNode.insertBefore(t, el.nextSibling);
  29.  
  30. br = document.getElementById(t.id).nextSibling;
  31. br.style.lineHeight = ".8em";
  32. }
  33. });