Last active
February 1, 2019 06:45
-
-
Save ajhsu/5bc193ee8f89f5dd6f85daa9c12e861d to your computer and use it in GitHub Desktop.
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 Wikipedia Redirection | |
// @version 0.0.1 | |
// @author AJ Hsu <[email protected]> | |
// @match https://zh.wikipedia.org/wiki/* | |
// @grant none | |
// ==/UserScript== | |
window.addEventListener('load', function handleLoaded() { | |
window.removeEventListener('load', handleLoaded); | |
const englishAnchor = document | |
.querySelector('li.interlanguage-link.interwiki-en') | |
.querySelector('a'); | |
const span = document.createElement('span'); | |
span.classList.add('mw-editsection'); | |
span.appendChild(englishAnchor); | |
document.querySelector('h1#firstHeading').appendChild(span); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment