16
|
1 // ==UserScript==
|
|
2 // @name mandarake direct link
|
|
3 // @namespace https://myconan.net
|
77
|
4 // @version 1.3.5
|
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
|
77
|
10 // @downloadURL https://hg.sr.ht/~nanaya/ec-userscripts/raw/mandarake-direct-link.user.js?rev=tip
|
16
|
11 // ==/UserScript==
|
|
12
|
66
|
13 /* global $ */
|
|
14 ;(function () {
|
|
15 'use strict'
|
51
|
16
|
66
|
17 $('.r18mark').remove()
|
|
18 $(".r18item ~ a[href^='#adult_confirm']").remove()
|
51
|
19
|
66
|
20 var fixR18Link = function (_i, el) {
|
|
21 var url = `/order/detailPage/item?itemCode=${el.id}`
|
16
|
22
|
66
|
23 el.setAttribute('href', url)
|
|
24 el.setAttribute('class', '')
|
|
25 }
|
16
|
26
|
66
|
27 $("[href^='#adult_confirm']").each(fixR18Link)
|
48
|
28
|
66
|
29 var currentQuery = new URLSearchParams(window.location.search)
|
|
30 var fixSearchLink = function (_i, el) {
|
|
31 var query = new URLSearchParams(el.search)
|
48
|
32
|
72
|
33 for (const [key, value] of currentQuery) {
|
48
|
34 if (!query.has(key)) {
|
66
|
35 query.set(key, value)
|
48
|
36 }
|
|
37 }
|
|
38
|
66
|
39 el.setAttribute('href', `/order/listPage/list?${query.toString()}`)
|
|
40 }
|
48
|
41
|
66
|
42 $("[href^='/order/listPage/list?']").each(fixSearchLink)
|
|
43 }).call()
|