JAVA DOCs site style change

JAVA…  from time to time one needs to use it’s DOCs site (Java Platform Standard Edition Documentation). Man.. I hate JAVA… and the website design with its documentation is SO UGLY and thus inconvenient to use, I had to finally change that. Searched the internet for a quick solution on how to override CSS in a browser. Well.. Greasemonkey for Firefox has just removed the GM_addStyle (cool).

Quick and simple script for CSS style change and a sample url to visit: the String class description. I needed just a few temporary tweaks while examining the String structure, so it’s not a full site solution.

[code language=”javascript”]

// ==UserScript==
// @version 1
// @include*
// ==/UserScript==
// Function addGlobalStyle body taken probably
// from here:

function addGlobalStyle(css) {
var head, style;
head = document.getElementsByTagName(‘head’)[0];
if (!head) { return; }
style = document.createElement(‘style’);
style.type = ‘text/css’;
style.innerHTML = css;

addGlobalStyle ( `
a {font-weight:bold;
color:#b33 !important;
td.colLast a {color:#b33 !important; }
td {padding-top:8pt !important; padding-bottom:8pt !important;}
pre,code {font-size:11pt !important;color:green}

` );


Leave a Reply

Your email address will not be published. Required fields are marked *