Created
June 1, 2020 11:39
-
-
Save sillyslux/3945019844715adb4113e8fb7a444d0c 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 MDN anchor links | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://developer.mozilla.org/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
document.head.insertAdjacentHTML('beforeEnd', ` | |
<style> | |
*:hover > .silly-anchor-links { | |
content: ""; | |
width: 28px; | |
height: 28px; | |
position: absolute; | |
background: gray; | |
box-shadow: inset 0 0 0 5px red, inset 0 0 0 10px white; | |
border-radius: 50%; | |
} | |
</style> | |
`); | |
document.querySelectorAll('[id]').forEach(el => el.insertAdjacentHTML('afterBegin', `<a class="silly-anchor-links" href="#${el.id}"></a>`)); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment