批量打开多个网址,支持设置时间间隔
< Rückmeldungen auf 快速打开粘贴的多个网址
// 更完善的URL识别正则表达式 const urlRegex = /(https?:\/\/[^\s]+)/gi; // 打开按钮点击事件 btn.onclick = function() { const text = textarea.value; const urls = text.match(urlRegex) || []; if (urls.length === 0) { alert("未检测到有效的URL!"); return; } // 去重并打开URL const uniqueUrls = [...new Set(urls)]; uniqueUrls.forEach((url, i) => { setTimeout(() => { window.open(url.trim(), '_blank'); }, i * time_input.value); }); document.body.removeChild(div); };添加修改以上内容可以更方便打开网址
Anmelden um eine Antwort zu senden.
// 更完善的URL识别正则表达式
const urlRegex = /(https?:\/\/[^\s]+)/gi;
// 打开按钮点击事件
btn.onclick = function() {
const text = textarea.value;
const urls = text.match(urlRegex) || [];
if (urls.length === 0) {
alert("未检测到有效的URL!");
return;
}
// 去重并打开URL
const uniqueUrls = [...new Set(urls)];
uniqueUrls.forEach((url, i) => {
setTimeout(() => {
window.open(url.trim(), '_blank');
}, i * time_input.value);
});
document.body.removeChild(div);
};
添加修改以上内容可以更方便打开网址