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

Function getUrlData

tools/jd_cfd_SlotMachine.js:322–339  ·  view source on GitHub ↗

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

(url, name)

Source from the content-addressed store, hash-verified

320 * @returns {string}
321 */
322function getUrlData(url, name) {
323 if (typeof URL !== "undefined") {
324 let urls = new URL(url);
325 let data = urls.searchParams.get(name);
326 return data ? data : '';
327 } else {
328 const query = url.match(/\?.*/)[0].substring(1)
329 const vars = query.split('&')
330 for (let i = 0; i < vars.length; i++) {
331 const pair = vars[i].split('=')
332 if (pair[0] === name) {
333 // return pair[1];
334 return vars[i].substr(vars[i].indexOf('=') + 1);
335 }
336 }
337 return ''
338 }
339}
340
341/**
342 * 模拟生成 fingerprint

Callers 1

decryptFunction · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected