comparison jiku-chu-direct-link.user.js @ 14:6415f831aa5a

(none)
author Edho Arief <me@myconan.net>
date Mon, 21 Sep 2015 06:34:01 +0000
parents
children aa43130ad87f
comparison
equal deleted inserted replaced
13:06e6dbdedd47 14:6415f831aa5a
1 // ==UserScript==
2 // @name Jiku-Chu direct link
3 // @namespace https://myconan.net
4 // @version 2.3
5 // @description Make proper link on Jiku-Chu pages
6 // @author nanaya
7 // @match http://www.jiku-chu.com/*
8 // @grant none
9 // ==/UserScript==
10
11 ;(function() {
12 Array.prototype.forEach.call(
13 document.querySelectorAll("a[onclick^=\"age_verification_submit('/products/detail.php?product_id=\"]"),
14 function(el) {
15 var
16 productId = el.getAttribute("onclick").replace(/.*product_id=(\d+).*/, "$1"),
17 url = "/products/detail.php?product_id=" + productId;
18 el.setAttribute("href", url);
19 el.setAttribute("onclick", "");
20 }
21 )
22 }).call();