-
Notifications
You must be signed in to change notification settings - Fork 0
/
martin-fowler-site-readability.user.js
39 lines (33 loc) · 1.15 KB
/
martin-fowler-site-readability.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// ==UserScript==
// @name Martin Fowler site readability
// @namespace http://udaykrishna.com/
// @version 0.2
// @description make martinfowler look cleaner!
// @author uday krishna
// @include /^https:\/\/(martinfowler|refactoring)\.com\/*/
// @icon https://www.google.com/s2/favicons?domain=martinfowler.com
// @grant none
// @copyright 2021, uday krishna (https://openuserjs.org/users/nickfever)
// @license MIT
// ==/UserScript==
(function() {
'use strict';
// Fix Headers and footers
const FULL_WIDTH = "100%";
const MARGIN_AUTO = "auto";
var header = document.getElementById("banner")
var footer = document.getElementById("page-footer");
[header, footer].forEach(elem=>{
elem.style.margin=MARGIN_AUTO;
elem.style.maxWidth=FULL_WIDTH;
});
// Fix Content
const BODY_WIDTH = "75%";
const BODY_MARGIN = "0px auto 0px auto";
var body = document.getElementsByTagName("body")[0];
var main = document.getElementsByTagName("main")[0];
[body, main].forEach(elem=>{
elem.style.margin = BODY_MARGIN;
elem.style.maxWidth = BODY_WIDTH;
});
})();