Mercurial > ec-userscripts
view jiku-chu-direct-link.user.js @ 73:521dda0a0b6f
Update update url
author | nanaya <me@nanaya.pro> |
---|---|
date | Fri, 03 Apr 2020 22:05:22 +0900 |
parents | 444b17e657be |
children | 5a3a269c5e6f |
line wrap: on
line source
// ==UserScript== // @name Jiku-Chu direct link // @namespace https://myconan.net // @version 2.5.4 // @description Make proper link on Jiku-Chu pages // @author nanaya // @match http://www.jiku-chu.com/* // @match https://www.jiku-chu.com/* // @grant none // @downloadURL https://hg.sr.ht/~nanaya/ec-userscripts/raw/default/jiku-chu-direct-link.user.js // ==/UserScript== ;(function () { 'use strict' const links = document.querySelectorAll("a[onclick^=\"age_verification_submit('/products/detail.php?product_id=\"]") const removeOnClick = function (el) { const productId = el.getAttribute('onclick').replace(/.*product_id=(\d+).*/, '$1') const url = `/products/detail.php?product_id=${productId}` el.setAttribute('href', url) el.setAttribute('onclick', '') } Array.prototype.forEach.call(links, removeOnClick) }())