comparison surugaya-fixes.user.js @ 106:42fbeb68c0e5

Product id may contain uppercase letters
author nanaya <me@nanaya.net>
date Sun, 15 Jan 2023 23:13:33 +0900
parents 6b354277f2d1
children 4bc5a633437c
comparison
equal deleted inserted replaced
105:6b354277f2d1 106:42fbeb68c0e5
1 // ==UserScript== 1 // ==UserScript==
2 // @name suruga-ya fixes 2 // @name suruga-ya fixes
3 // @namespace https://myconan.net 3 // @namespace https://myconan.net
4 // @version 2.0.0 4 // @version 2.0.1
5 // @description Show all products with fast image 5 // @description Show all products with fast image
6 // @author nanaya 6 // @author nanaya
7 // @match https://www.suruga-ya.jp/* 7 // @match https://www.suruga-ya.jp/*
8 // @grant none 8 // @grant none
9 // @downloadURL https://hg.myconan.net/ec-userscripts/raw-file/tip/surugaya-fixes.user.js 9 // @downloadURL https://hg.myconan.net/ec-userscripts/raw-file/tip/surugaya-fixes.user.js
22 } 22 }
23 })() 23 })()
24 24
25 // skip loading image through php which seems to take forever 25 // skip loading image through php which seems to take forever
26 ;(function () { 26 ;(function () {
27 const itemImageRegexp = /photo\.php\?shinaban=(\d+)/ 27 const itemImageRegexp = /photo\.php\?shinaban=([0-9A-Z]+)/
28 function fix (image) { 28 function fix (image) {
29 const origSrc = image.getAttribute('src') 29 const origSrc = image.getAttribute('src')
30 if (origSrc == null) return 30 if (origSrc == null) return
31 const found = origSrc.match(itemImageRegexp) 31 const found = origSrc.match(itemImageRegexp)
32 if (found == null) return 32 if (found == null) return