view pixiv-direct-external-link.user.js @ 24:8ce6738a3a81

(none)
author Edho Arief <me@myconan.net>
date Tue, 17 Nov 2015 10:56:29 +0000
parents 4b13157ae3a1
children 28505554a8b9
line wrap: on
line source

// ==UserScript==
// @name         pixiv direct external link
// @namespace    https://myconan.net
// @version      1.1.0
// @description  Make proper link on pixiv pages
// @author       nanaya
// @match        http://www.pixiv.net/*
// @grant        none
// @downloadURL  https://bitbucket.org/!api/2.0/snippets/nanaya1/TK64/tip/files/pixiv-direct-external-link.user.js
// ==/UserScript==

;(function() {
  var fixLink = function(_i, el) {
    var
      $el = $(el),
      url = decodeURIComponent($el.attr('href').replace(/^\/?jump.php\?/, ""));

    $el.attr('href', url);
  };

  $("[href^='jump.php?']").each(fixLink);
  $("[href^='/jump.php?']").each(fixLink);
}).call();