28 lines
1.2 KiB
JavaScript
28 lines
1.2 KiB
JavaScript
// ==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(/^<div /,"<blockquote ").replace(/<\/div>$/,"</blockquote>");
|
|
cur_quote.style = style_before;
|
|
}
|
|
})();
|