comparison jiku-chu-direct-link.user.js @ 49:2e1cae72a63e

Semicolons
author nanaya <me@nanaya.pro>
date Thu, 12 Oct 2017 16:40:13 +0900
parents 32a213717e6a
children e8517cc75a74
comparison
equal deleted inserted replaced
48:b60f0fd9c417 49:2e1cae72a63e
9 // @downloadURL https://bitbucket.org/!api/2.0/snippets/nanayapro/TK64/tip/files/jiku-chu-direct-link.user.js 9 // @downloadURL https://bitbucket.org/!api/2.0/snippets/nanayapro/TK64/tip/files/jiku-chu-direct-link.user.js
10 // ==/UserScript== 10 // ==/UserScript==
11 11
12 ;(function() { 12 ;(function() {
13 "use strict"; 13 "use strict";
14 var links = document.querySelectorAll("a[onclick^=\"age_verification_submit('/products/detail.php?product_id=\"]") 14 var links = document.querySelectorAll("a[onclick^=\"age_verification_submit('/products/detail.php?product_id=\"]");
15 var removeOnClick = function(el) { 15 var removeOnClick = function(el) {
16 var productId = el.getAttribute("onclick").replace(/.*product_id=(\d+).*/, "$1") 16 var productId = el.getAttribute("onclick").replace(/.*product_id=(\d+).*/, "$1");
17 var url = "/products/detail.php?product_id=" + productId 17 var url = "/products/detail.php?product_id=" + productId;
18 18
19 el.setAttribute("href", url) 19 el.setAttribute("href", url);
20 el.setAttribute("onclick", "") 20 el.setAttribute("onclick", "");
21 } 21 };
22 22
23 Array.prototype.forEach.call(links, removeOnClick) 23 Array.prototype.forEach.call(links, removeOnClick);
24 }).call(); 24 }).call();