const popupArr = []; // 1. 팝업 열기 function go(url) { const popup = window.open(url); if (popup) popupArr.push(popup); } const blockprofile = [ 'https://steamcommunity.com/profiles/76561198097083998/', 'https://steamcommunity.com/profiles/76561198048527840/', 'https://steamcommunity.com/profiles/76561199213161677/', 'https://steamcommunity.com/profiles/76561198396777477/', 'https://steamcommunity.com/profiles/76561199329817531/', 'https://steamcommunity.com/profiles/76561199162691211/', 'https://steamcommunity.com/profiles/76561198346286077/', 'https://steamcommunity.com/profiles/76561198331118143/', 'https://steamcommunity.com/profiles/76561199570566158/', 'https://steamcommunity.com/profiles/76561199184213762/', 'https://steamcommunity.com/profiles/76561198383886849/', 'https://steamcommunity.com/profiles/76561199786757904/', 'https://steamcommunity.com/profiles/76561198386234287/', 'https://steamcommunity.com/profiles/76561199616872758/', 'https://steamcommunity.com/profiles/76561198032026345/', 'https://steamcommunity.com/profiles/76561198257198510/', 'https://steamcommunity.com/profiles/76561198165167481/', 'https://steamcommunity.com/profiles/76561199830248818/', 'https://steamcommunity.com/profiles/76561198024025177/', 'https://steamcommunity.com/profiles/76561198787772241/', 'https://steamcommunity.com/profiles/76561198416617192/', 'https://steamcommunity.com/profiles/76561198363638564/', ]; for (let i = 0; i < blockprofile.length; i++) { go(blockprofile[i]); } // 2. 차단 실행 함수 function tryBlock(popup, retryCount = 0) { if (!popup || popup.closed) return; try { // 1-1. '더보기' 메뉴 클릭 const moreBtn = popup.document.querySelector('#profile_action_dropdown_link'); if (moreBtn) moreBtn.click(); // 1-2. 메뉴 뜰 시간 기다렸다가 버튼 탐색 setTimeout(() => { const blockBtn = popup.document.querySelector('#profile_action_dropdown a[href*="ConfirmBlock"]'); if (blockBtn) { blockBtn.click(); setTimeout(() => { const confirmBtn = popup.document.querySelector("body div.newmodal .btn_green_steamui.btn_medium"); if (confirmBtn) confirmBtn.click(); setTimeout(() => popup.close(), 5000); }, 3000); } else { // 실패: 재시도 허용 if (retryCount < 3) { console.warn(`차단 버튼 없음. 새로고침 시도 ${retryCount + 1}/3`); popup.location.reload(); // 2초 후 다시 시도 setTimeout(() => { tryBlock(popup, retryCount + 1); }, 2000); } else { console.warn(`차단 실패 (최대 재시도): 창 닫기`); popup.close(); } } }, 1000); } catch (e) { console.warn('문서 접근 실패:', e); } } // 3. 10초 후 모든 창에서 차단 시도 setTimeout(() => { for (let i = 0; i < popupArr.length; i++) { tryBlock(popupArr[i], 0); } }, 10000);