Mercurial > ec-userscripts
annotate pixiv-direct-external-link.user.js @ 130:49658e99888a
[medium] update class name and use document level styling instead
author | nanaya <me@nanaya.net> |
---|---|
date | Sun, 26 Feb 2023 20:09:37 +0900 |
parents | 8de2d53a4cb1 |
children |
rev | line source |
---|---|
14 | 1 // ==UserScript== |
118 | 2 // @name pixiv direct external link |
3 // @namespace https://nanaya.net | |
4 // @version 1.1.5 | |
5 // @description Make proper link on pixiv pages | |
6 // @author nanaya | |
7 // @match http://www.pixiv.net/* | |
8 // @grant none | |
9 // @downloadURL https://hg.nanaya.net/ec-userscripts/raw-file/tip/pixiv-direct-external-link.user.js | |
14 | 10 // ==/UserScript== |
11 | |
109 | 12 'use strict'; |
13 | |
66 | 14 /* global $ */ |
117
d9dc190bccaf
Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents:
109
diff
changeset
|
15 const fixLink = function (_i, el) { |
d9dc190bccaf
Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents:
109
diff
changeset
|
16 const $el = $(el); |
d9dc190bccaf
Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents:
109
diff
changeset
|
17 const url = decodeURIComponent($el.attr('href').replace(/^\/?jump.php\?/, '')); |
14 | 18 |
117
d9dc190bccaf
Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents:
109
diff
changeset
|
19 $el.attr('href', url); |
d9dc190bccaf
Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents:
109
diff
changeset
|
20 }; |
66 | 21 |
117
d9dc190bccaf
Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents:
109
diff
changeset
|
22 $("[href^='jump.php?']").each(fixLink); |
d9dc190bccaf
Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents:
109
diff
changeset
|
23 $("[href^='/jump.php?']").each(fixLink); |