const popupArr = []; // 1. 팝업 열기 function go(url) { const popup = window.open(url); if (popup) popupArr.push(popup); } const blockprofile = [ 'https://steamcommunity.com/profiles/76561199045953415/', 'https://steamcommunity.com/profiles/76561199697390650/', 'https://steamcommunity.com/profiles/76561198449038604/', 'https://steamcommunity.com/profiles/76561199848702979/', 'https://steamcommunity.com/profiles/76561199820306790/', 'https://steamcommunity.com/profiles/76561198302652016/', 'https://steamcommunity.com/profiles/76561199107493025/', 'https://steamcommunity.com/profiles/76561199670084092/', 'https://steamcommunity.com/profiles/76561199071720168/', 'https://steamcommunity.com/profiles/76561198213858384/', 'https://steamcommunity.com/profiles/76561199850578302/', 'https://steamcommunity.com/profiles/76561199849903827/', 'https://steamcommunity.com/profiles/76561198022172251/', 'https://steamcommunity.com/profiles/76561198101896600/', 'https://steamcommunity.com/profiles/76561199684199087/', 'https://steamcommunity.com/profiles/76561199567974991/', 'https://steamcommunity.com/profiles/76561199613931764/', 'https://steamcommunity.com/profiles/76561198145835312/', 'https://steamcommunity.com/profiles/76561198149089901/', 'https://steamcommunity.com/profiles/76561199206147802/', 'https://steamcommunity.com/profiles/76561198313871141/', 'https://steamcommunity.com/profiles/76561199131518037/', 'https://steamcommunity.com/profiles/76561199521823828/', 'https://steamcommunity.com/profiles/76561198195646655/', 'https://steamcommunity.com/profiles/76561198425816036/', 'https://steamcommunity.com/profiles/76561199081364323/', 'https://steamcommunity.com/profiles/76561199526333734/', 'https://steamcommunity.com/profiles/76561198005336557/', 'https://steamcommunity.com/profiles/76561198366398364/', 'https://steamcommunity.com/profiles/76561198212068004/', 'https://steamcommunity.com/profiles/76561199816820913/', 'https://steamcommunity.com/profiles/76561198065513077/', 'https://steamcommunity.com/profiles/76561198113864804/', 'https://steamcommunity.com/profiles/76561198979841739/', 'https://steamcommunity.com/profiles/76561199802800341/', 'https://steamcommunity.com/profiles/76561199191849523/', 'https://steamcommunity.com/profiles/76561199617732485/', 'https://steamcommunity.com/profiles/76561198983430170/', 'https://steamcommunity.com/profiles/76561198062826175/', 'https://steamcommunity.com/profiles/76561198806351129/', 'https://steamcommunity.com/profiles/76561199477465358/', 'https://steamcommunity.com/profiles/76561199214142759/', 'https://steamcommunity.com/profiles/76561199235500538/', 'https://steamcommunity.com/profiles/76561199874387166/', 'https://steamcommunity.com/profiles/76561198153939634/', 'https://steamcommunity.com/profiles/76561198402054001/', 'https://steamcommunity.com/profiles/76561199617982509/', 'https://steamcommunity.com/profiles/76561198303644030/', 'https://steamcommunity.com/profiles/76561198009665804/', 'https://steamcommunity.com/profiles/76561199530566810/', ]; 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);