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

Function getUrlData

jd_cfd.js:1786–1803  ·  view source on GitHub ↗

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

(url, name)

Source from the content-addressed store, hash-verified

1784 * @returns {string}
1785 */
1786function getUrlData(url, name) {
1787 if (typeof URL !== "undefined") {
1788 let urls = new URL(url);
1789 let data = urls.searchParams.get(name);
1790 return data ? data : '';
1791 } else {
1792 const query = url.match(/\?.*/)[0].substring(1)
1793 const vars = query.split('&')
1794 for (let i = 0; i < vars.length; i++) {
1795 const pair = vars[i].split('=')
1796 if (pair[0] === name) {
1797 // return pair[1];
1798 return vars[i].substr(vars[i].indexOf('=') + 1);
1799 }
1800 }
1801 return ''
1802 }
1803}
1804/**
1805 * 模拟生成 fingerprint
1806 * @returns {string}

Callers 1

decryptFunction · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected