16
|
1 // ==UserScript==
|
|
2 // @name mandarake direct link
|
|
3 // @namespace https://myconan.net
|
48
|
4 // @version 1.3.0
|
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
|
35
|
10 // @downloadURL https://bitbucket.org/!api/2.0/snippets/nanayapro/TK64/tip/files/mandarake-direct-link.user.js
|
16
|
11 // ==/UserScript==
|
|
12
|
|
13 ;(function() {
|
33
|
14 "use strict";
|
49
|
15 $(".r18mark").remove();
|
48
|
16 var fixR18Link = function(_i, el) {
|
49
|
17 var url = `/order/detailPage/item?itemCode=${el.id}`;
|
16
|
18
|
49
|
19 el.setAttribute("href", url);
|
|
20 el.setAttribute("class", "");
|
|
21 };
|
16
|
22
|
49
|
23 $("[href^='#adult_confirm']").each(fixR18Link);
|
48
|
24
|
49
|
25 var currentQuery = new URLSearchParams(location.search);
|
48
|
26 var fixSearchLink = function(_i, el) {
|
49
|
27 var query = new URLSearchParams(el.search);
|
48
|
28
|
|
29 for (let [key, value] of currentQuery) {
|
|
30 if (!query.has(key)) {
|
49
|
31 query.set(key, value);
|
48
|
32 }
|
|
33 }
|
|
34
|
49
|
35 el.setAttribute("href", `/order/listPage/list?${query.toString()}`);
|
|
36 };
|
48
|
37
|
49
|
38 $("[href^='/order/listPage/list?']").each(fixSearchLink);
|
48
|
39 }).call();
|