Mercurial > ec-userscripts
annotate mandarake-direct-link.user.js @ 58:960d452dea99
Bump version to force updating to new repository
author | nanaya <me@nanaya.pro> |
---|---|
date | Thu, 23 Aug 2018 22:58:16 +0900 |
parents | 09f735548b2c |
children | 444b17e657be |
rev | line source |
---|---|
16 | 1 // ==UserScript== |
2 // @name mandarake direct link | |
3 // @namespace https://myconan.net | |
58
960d452dea99
Bump version to force updating to new repository
nanaya <me@nanaya.pro>
parents:
57
diff
changeset
|
4 // @version 1.3.3 |
16 | 5 // @description Make proper link on mandarake pages |
6 // @author nanaya | |
7 // @match https://order.mandarake.co.jp/* | |
18 | 8 // @match http://order.mandarake.co.jp/* |
16 | 9 // @grant none |
57 | 10 // @downloadURL https://bitbucket.org/nanayapro/ec-userscripts/raw/tip/mandarake-direct-link.user.js |
16 | 11 // ==/UserScript== |
12 | |
13 ;(function() { | |
33 | 14 "use strict"; |
51 | 15 |
49 | 16 $(".r18mark").remove(); |
52 | 17 $(".r18item ~ a[href^='#adult_confirm']").remove(); |
51 | 18 |
48 | 19 var fixR18Link = function(_i, el) { |
49 | 20 var url = `/order/detailPage/item?itemCode=${el.id}`; |
16 | 21 |
49 | 22 el.setAttribute("href", url); |
23 el.setAttribute("class", ""); | |
24 }; | |
16 | 25 |
49 | 26 $("[href^='#adult_confirm']").each(fixR18Link); |
48 | 27 |
49 | 28 var currentQuery = new URLSearchParams(location.search); |
48 | 29 var fixSearchLink = function(_i, el) { |
49 | 30 var query = new URLSearchParams(el.search); |
48 | 31 |
32 for (let [key, value] of currentQuery) { | |
33 if (!query.has(key)) { | |
49 | 34 query.set(key, value); |
48 | 35 } |
36 } | |
37 | |
49 | 38 el.setAttribute("href", `/order/listPage/list?${query.toString()}`); |
39 }; | |
48 | 40 |
49 | 41 $("[href^='/order/listPage/list?']").each(fixSearchLink); |
48 | 42 }).call(); |