MCPcopy
hub / github.com/ChinaGodMan/UserScripts / processUrl

Function processUrl

missav-explorer/missav-explorer.user.js:514–532  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

512 }
513
514 function processUrl(url) {
515 // 检查是否包含 `page=` 参数
516 var pageIndex = url.indexOf('page=')
517
518 if (pageIndex !== -1) {
519 // 找到 `page=` 参数并删除它及其后的所有内容
520 var baseUrl = url.substring(0, pageIndex + 5) // +5 to include `page=`
521 return baseUrl
522 } else {
523 // 检查是否已有其他参数
524 if (url.includes('?')) {
525 // 有其他参数,添加 `&page=`
526 return url + '&page='
527 } else {
528 // 没有其他参数,添加 `?page=`
529 return url + '?page='
530 }
531 }
532 }
533 function settime() {
534 // 让用户输入延时时间
535 delayTime = prompt('请输入每页请求的延时时间(毫秒):', '1000')

Callers 2

fetchPageFunction · 0.85
processPageContentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected