MCPcopy Create free account
hub / github.com/Semporia/Scripts / getUrlData

Function getUrlData

jd_cfd_loop.js:554–571  ·  view source on GitHub ↗

* 获取url参数值 * @param url * @param name * @returns {string}

(url, name)

Source from the content-addressed store, hash-verified

552 * @returns {string}
553 */
554function getUrlData(url, name) {
555 if (typeof URL !== "undefined") {
556 let urls = new URL(url);
557 let data = urls.searchParams.get(name);
558 return data ? data : '';
559 } else {
560 const query = url.match(/\?.*/)[0].substring(1)
561 const vars = query.split('&')
562 for (let i = 0; i < vars.length; i++) {
563 const pair = vars[i].split('=')
564 if (pair[0] === name) {
565 // return pair[1];
566 return vars[i].substr(vars[i].indexOf('=') + 1);
567 }
568 }
569 return ''
570 }
571}
572/**
573 * 模拟生成 fingerprint
574 * @returns {string}

Callers 1

decryptFunction · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected