view pixiv-direct-external-link.user.js @ 36:11568ae07bf5

(none)
author Edho Arief <me@nanaya.pro>
date Thu, 20 Jul 2017 08:43:51 +0000
parents 32a213717e6a
children 2e1cae72a63e
line wrap: on
line source

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

;(function() {
  "use strict";

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

    $el.attr("href", url)
  }

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