Skip to content

Commit bf4fe21

Browse files
committed
visited-links: update for newer GreaseMonkey
1 parent b95bd17 commit bf4fe21

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

visited-links.user.js

+13-7
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,24 @@
22
// @name visited links
33
// @namespace https://github.com/lilydjwg/userscripts
44
// @description Use default color for visited links
5-
// @version 1.1
6-
// @grant GM_addStyle
7-
// @include http://docs.python-requests.org/*
5+
// @version 2.0
86
// @include http://www.yaml.org/*
97
// @include https://pythonhosted.org/*
108
// @include http://www.freelists.org/*
119
// @include https://*.readthedocs.io/*
1210
// @include http://docs.wand-py.org/*
1311
// ==/UserScript==
1412

15-
/* global GM_addStyle */
13+
const css = 'a:visited { color: #551a8b !important; }'
14+
addStyle(css)
1615

17-
let css
18-
css = 'a:visited { color: #551a8b !important; }'
19-
GM_addStyle(css)
16+
function addStyle(css) {
17+
const head = document.getElementsByTagName('head')[0]
18+
if (head) {
19+
const style = document.createElement('style')
20+
style.setAttribute('type', 'text/css')
21+
style.textContent = css
22+
head.appendChild(style)
23+
return style
24+
}
25+
}

0 commit comments

Comments
 (0)