Last active
June 29, 2020 06:47
-
-
Save Marco3jp/0e30565a647aacac4dd40c29c03a7c9b to your computer and use it in GitHub Desktop.
Look at Wikipedia reality
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Look-at-Wikipedia-reality | |
// @namespace https://marco.plus | |
// @version 1.0 | |
// @author Marco | |
// @match https://ja.wikipedia.org/wiki/* | |
// @homepage https://marco.plus | |
// @website https://twitter.com/Marco_utau | |
// ==/UserScript== | |
// == ISSUE == | |
// 1. ヘルプページが除外されていない | |
// 2. 出典無効が出典扱いになっている | |
// 1. LINK.1がインラインテンプレートの一覧で、これらで同様の不具合が発生するはず | |
// 3. 化学系の記事でイオンを表すときの上付き文字が出典扱いになっている | |
// == LINK == | |
// 1. https://ja.wikipedia.org/wiki/Category:%E3%82%A4%E3%83%B3%E3%83%A9%E3%82%A4%E3%83%B3%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88 | |
// == TODO == | |
// - リストに対応 | |
// - 図表に対応 | |
// - {{出典の明記}}などを簡単に挿入したい | |
(function() { | |
'use strict'; | |
if (document.querySelector(".ns-talk, body[class*='page-Wikipedia_']") !== null){ | |
// トークページとWikipediaページを除外 | |
return; | |
} | |
const elms = document.querySelectorAll("#bodyContent > #mw-content-text > .mw-parser-output > p"); | |
elms.forEach(elm => { | |
if(elm.querySelector("sup:not(.Template-Fact)") === null){ | |
elm.style.backgroundColor = "rgba(207,216,220 ,1)"; | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment