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