view pixiv-direct-external-link.user.js @ 14:6415f831aa5a

(none)
author Edho Arief <me@myconan.net>
date Mon, 21 Sep 2015 06:34:01 +0000
parents
children aa43130ad87f
line wrap: on
line source

// ==UserScript==
// @name         pixiv direct external link
// @namespace    https://myconan.net
// @version      1.0
// @description  Make proper link on pixiv pages
// @author       nanaya
// @match        http://www.pixiv.net/*
// @grant        none
// ==/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();