Create lwn-blockquotes.user.js
This commit is contained in:
parent
c34a675235
commit
335b4111a0
1 changed files with 27 additions and 0 deletions
27
lwn-blockquotes.user.js
Normal file
27
lwn-blockquotes.user.js
Normal file
|
@ -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(/^<div /,"<blockquote ").replace(/<\/div>$/,"</blockquote>");
|
||||
cur_quote.style = style_before;
|
||||
}
|
||||
})();
|
Loading…
Reference in a new issue