comparison pixiv-direct-external-link.user.js @ 33:28505554a8b9

(none)
author Edho Arief <me@myconan.net>
date Sun, 25 Dec 2016 07:41:17 +0000
parents 4b13157ae3a1
children 32a213717e6a
comparison
equal deleted inserted replaced
32:41953e59d06f 33:28505554a8b9
1 // ==UserScript== 1 // ==UserScript==
2 // @name pixiv direct external link 2 // @name pixiv direct external link
3 // @namespace https://myconan.net 3 // @namespace https://myconan.net
4 // @version 1.1.0 4 // @version 1.1.1
5 // @description Make proper link on pixiv pages 5 // @description Make proper link on pixiv pages
6 // @author nanaya 6 // @author nanaya
7 // @match http://www.pixiv.net/* 7 // @match http://www.pixiv.net/*
8 // @grant none 8 // @grant none
9 // @downloadURL https://bitbucket.org/!api/2.0/snippets/nanaya1/TK64/tip/files/pixiv-direct-external-link.user.js 9 // @downloadURL https://bitbucket.org/!api/2.0/snippets/nanaya1/TK64/tip/files/pixiv-direct-external-link.user.js
10 // ==/UserScript== 10 // ==/UserScript==
11 11
12 ;(function() { 12 ;(function() {
13 "use strict";
14
13 var fixLink = function(_i, el) { 15 var fixLink = function(_i, el) {
14 var 16 var $el = $(el)
15 $el = $(el), 17 var url = decodeURIComponent($el.attr("href").replace(/^\/?jump.php\?/, ""))
16 url = decodeURIComponent($el.attr('href').replace(/^\/?jump.php\?/, ""));
17 18
18 $el.attr('href', url); 19 $el.attr("href", url)
19 }; 20 }
20 21
21 $("[href^='jump.php?']").each(fixLink); 22 $("[href^='jump.php?']").each(fixLink)
22 $("[href^='/jump.php?']").each(fixLink); 23 $("[href^='/jump.php?']").each(fixLink)
23 }).call(); 24 }).call();