File tree 1 file changed +13
-7
lines changed
1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change 2
2
// @name visited links
3
3
// @namespace https://github.com/lilydjwg/userscripts
4
4
// @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
8
6
// @include http://www.yaml.org/*
9
7
// @include https://pythonhosted.org/*
10
8
// @include http://www.freelists.org/*
11
9
// @include https://*.readthedocs.io/*
12
10
// @include http://docs.wand-py.org/*
13
11
// ==/UserScript==
14
12
15
- /* global GM_addStyle */
13
+ const css = 'a:visited { color: #551a8b !important; }'
14
+ addStyle ( css )
16
15
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
+ }
You can’t perform that action at this time.
0 commit comments