Skip to content

Instantly share code, notes, and snippets.

@miclf
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miclf/44c634f1d3487f1008ac to your computer and use it in GitHub Desktop.
Save miclf/44c634f1d3487f1008ac to your computer and use it in GitHub Desktop.
Make the Belgian official journal less unreadable
javascript:(function(){document.body.style.background='#fff';var%20table=document.querySelectorAll('table');if(!table||table.length<4)return;with(table[3].style){maxWidth='50em';marginLeft=marginRight='auto';border='1px%20solid%20#999';}var%20th=table[3].querySelector('tr:nth-child(2)%20th');with(th.style){padding='2em';border='0';backgroundColor='#fff';fontFamily='Lucida%20Grande,%20Lucida%20Sans,%20Lucida%20Sans%20Unicode,%20sans-serif';fontWeight='normal';lineHeight='1.4';}})();

The online Belgian official journal is unreadable. Have a look to see what I mean.

In order to remove some of the pain, here is a quick-and-dirty bookmarklet that can be used to reformat the content in a more readable way.

To make it work, you must remove all the frames (yes, it uses frames) by accessing the real document page directly. For security reasons, JavaScript is not allowed to dig up the framesets for you. In Firefox, you can do that simply from the context menu.

I can’t provide a draggable install link, GitHub detected it and removed it.

// Start by removing the amazing background colour of the page
document.body.style.background = '#fff';
// Select the table containing the main content
var table = document.querySelectorAll('table');
if (!table || table.length < 4) return;
// Set some styles on the <table>
with(table[3].style) {
maxWidth = '50em';
marginLeft = marginRight = 'auto';
border = '1px solid #999';
}
// Then, get the <th> storing the content itself
var th = table[3].querySelector('tr:nth-child(2) th');
// And set some styles on it
with (th.style) {
padding = '2em';
border = '0';
backgroundColor = '#fff';
fontFamily = 'Lucida Grande, Lucida Sans, Lucida Sans Unicode, sans-serif';
fontWeight = 'normal';
lineHeight = '1.4';
}
// Done. Enjoy the legalese in all its glory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment