const popupArr = []; // 1. 팝업 열기 function go(url) { const popup = window.open(url); if (popup) popupArr.push(popup); } const blockprofile = [ 'https://steamcommunity.com/profiles/76561198115048639/', 'https://steamcommunity.com/profiles/76561198830196720/', 'https://steamcommunity.com/profiles/76561198061416516/', 'https://steamcommunity.com/profiles/76561199088517761/', 'https://steamcommunity.com/profiles/76561199637739292/', 'https://steamcommunity.com/profiles/76561198326290621/', 'https://steamcommunity.com/profiles/76561199317198392/', 'https://steamcommunity.com/profiles/76561198931746783/', 'https://steamcommunity.com/profiles/76561199317148259/', 'https://steamcommunity.com/profiles/76561198122794020/', 'https://steamcommunity.com/profiles/76561199611187319/', 'https://steamcommunity.com/profiles/76561198986230475/', 'https://steamcommunity.com/profiles/76561199406922682/', 'https://steamcommunity.com/profiles/76561198867130733/', 'https://steamcommunity.com/profiles/76561199443112548/', 'https://steamcommunity.com/profiles/76561199659947010/', 'https://steamcommunity.com/profiles/76561199610934186/', 'https://steamcommunity.com/profiles/76561199079240441/', 'https://steamcommunity.com/profiles/76561199206294369/', 'https://steamcommunity.com/profiles/76561198971444098/', 'https://steamcommunity.com/profiles/76561199316212879/', 'https://steamcommunity.com/profiles/76561198408981381/', 'https://steamcommunity.com/profiles/76561199059196699/', 'https://steamcommunity.com/profiles/76561198057984359/', 'https://steamcommunity.com/profiles/76561199417639786/', 'https://steamcommunity.com/profiles/76561198203786692/', 'https://steamcommunity.com/profiles/76561198027987614/', 'https://steamcommunity.com/profiles/76561198369664663/', 'https://steamcommunity.com/profiles/76561199142540086/', 'https://steamcommunity.com/profiles/76561199063138795/', 'https://steamcommunity.com/profiles/76561199087624767/', 'https://steamcommunity.com/profiles/76561198093435250/', 'https://steamcommunity.com/profiles/76561199427132560/', 'https://steamcommunity.com/profiles/76561199659092123/', 'https://steamcommunity.com/profiles/76561198964793051/', 'https://steamcommunity.com/profiles/76561199428539023', 'https://steamcommunity.com/profiles/76561199247145076/', 'https://steamcommunity.com/profiles/76561199479757321/', 'https://steamcommunity.com/profiles/76561198071781584/', 'https://steamcommunity.com/profiles/76561199177573813/', 'https://steamcommunity.com/profiles/76561198986212039/', 'https://steamcommunity.com/profiles/76561199329371754/', 'https://steamcommunity.com/profiles/76561199429989784/', 'https://steamcommunity.com/profiles/76561199684023672/', 'https://steamcommunity.com/profiles/76561199656345359/', 'https://steamcommunity.com/profiles/76561199501068683/', 'https://steamcommunity.com/profiles/76561199021839365/', 'https://steamcommunity.com/profiles/76561199699654777/', 'https://steamcommunity.com/profiles/76561199231219465/', 'https://steamcommunity.com/profiles/76561198061845709/' ]; 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);