We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f53dbb6 + e0fe2ce commit 3e5d27dCopy full SHA for 3e5d27d
1 file changed
_worker.js
@@ -871,9 +871,10 @@ function 随机替换通配符(h) {
871
}
872
873
function 批量替换域名(内容, hosts, 每组数量 = 2) {
874
+ const 打乱后数组 = [...hosts].sort(() => Math.random() - 0.5);
875
let count = 0, currentRandomHost = null;
876
return 内容.replace(/example\.com/g, () => {
- if (count % 每组数量 === 0) currentRandomHost = 随机替换通配符(hosts[Math.floor(Math.random() * hosts.length)]);
877
+ if (count % 每组数量 === 0) currentRandomHost = 随机替换通配符(打乱后数组[count % 打乱后数组.length]);
878
count++;
879
return currentRandomHost;
880
});
0 commit comments