From 335b4111a0304790775a4ca1e9dd110c43855939 Mon Sep 17 00:00:00 2001 From: Tobias Schmidl Date: Tue, 28 Jan 2020 12:42:18 +0100 Subject: [PATCH] Create lwn-blockquotes.user.js --- lwn-blockquotes.user.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 lwn-blockquotes.user.js diff --git a/lwn-blockquotes.user.js b/lwn-blockquotes.user.js new file mode 100644 index 0000000..48ba783 --- /dev/null +++ b/lwn-blockquotes.user.js @@ -0,0 +1,27 @@ +// ==UserScript== +// @name LWN-Blockquotes +// @namespace https://www.schtobia.de/ +// @version 0.1 +// @description Format the Blockquotes correctly on LWN. This is important for Reader View. +// @author Tobias Schmidl +// @match https://lwn.net/Articles/* +// @grant none +// @downloadURL https://github.com/schtobia/greasemonkey/raw/master/lwn-blockquotes.user.js +// @updateURL https://github.com/schtobia/greasemonkey/raw/master/lwn-blockquotes.user.js +// ==/UserScript== + +(function() { + 'use strict'; + + for (let cur_quote of document.getElementsByClassName('BigQuote')) + { + const style_before = window.getComputedStyle(cur_quote); + const margin_left = style_before.getPropertyValue("margin-left"), + margin_right = style_before.getPropertyValue("margin-right"), + margin_top = style_before.getPropertyValue("margin-top"), + margin_bottom = style_before.getPropertyValue("margin-bottom"), + color = style_before.getPropertyValue("color"); + cur_quote.outerHTML = cur_quote.outerHTML.replace(/^
$/,""); + cur_quote.style = style_before; + } +})();