Mercurial > ec-userscripts
comparison jiku-chu-direct-link.user.js @ 108:2c4470b73ad9
Switch to semistandard
No more `;` at the start of line.
author | nanaya <me@nanaya.net> |
---|---|
date | Sun, 15 Jan 2023 23:24:03 +0900 |
parents | 86da34e62d29 |
children | ef21ef445fc6 |
comparison
equal
deleted
inserted
replaced
107:4bc5a633437c | 108:2c4470b73ad9 |
---|---|
8 // @match https://www.jiku-chu.com/* | 8 // @match https://www.jiku-chu.com/* |
9 // @grant none | 9 // @grant none |
10 // @downloadURL https://hg.myconan.net/ec-userscripts/raw-file/tip/jiku-chu-direct-link.user.js | 10 // @downloadURL https://hg.myconan.net/ec-userscripts/raw-file/tip/jiku-chu-direct-link.user.js |
11 // ==/UserScript== | 11 // ==/UserScript== |
12 | 12 |
13 ;(function () { | 13 (function () { |
14 'use strict' | 14 'use strict'; |
15 const links = document.querySelectorAll("a[onclick^=\"age_verification_submit('/products/detail.php?product_id=\"]") | 15 const links = document.querySelectorAll("a[onclick^=\"age_verification_submit('/products/detail.php?product_id=\"]"); |
16 const removeOnClick = function (el) { | 16 const removeOnClick = function (el) { |
17 const productId = el.getAttribute('onclick').replace(/.*product_id=(\d+).*/, '$1') | 17 const productId = el.getAttribute('onclick').replace(/.*product_id=(\d+).*/, '$1'); |
18 const url = `/products/detail.php?product_id=${productId}` | 18 const url = `/products/detail.php?product_id=${productId}`; |
19 | 19 |
20 el.setAttribute('href', url) | 20 el.setAttribute('href', url); |
21 el.setAttribute('onclick', '') | 21 el.setAttribute('onclick', ''); |
22 } | 22 }; |
23 | 23 |
24 Array.prototype.forEach.call(links, removeOnClick) | 24 Array.prototype.forEach.call(links, removeOnClick); |
25 }()) | 25 }()); |