const popupArr = []; // 1. 팝업 열기 function go(url) { const popup = window.open(url); if (popup) popupArr.push(popup); } const blockprofile = [ 'https://steamcommunity.com/profiles/76561198354428439/', 'https://steamcommunity.com/profiles/76561198360319206/', 'https://steamcommunity.com/profiles/76561199638132076/', 'https://steamcommunity.com/profiles/76561199676336586/', 'https://steamcommunity.com/profiles/76561199028812390/', 'https://steamcommunity.com/profiles/76561199766425745/', 'https://steamcommunity.com/profiles/76561199285963336/', 'https://steamcommunity.com/profiles/76561199522275199/', 'https://steamcommunity.com/profiles/76561198983908148/', 'https://steamcommunity.com/profiles/76561199480680386/', 'https://steamcommunity.com/profiles/76561199775291936/', 'https://steamcommunity.com/profiles/76561199568775524/', 'https://steamcommunity.com/profiles/76561199191319983/', 'https://steamcommunity.com/profiles/76561199681333964/', 'https://steamcommunity.com/profiles/76561199781550893/', 'https://steamcommunity.com/profiles/76561199777582978/', 'https://steamcommunity.com/profiles/76561199315618696/', 'https://steamcommunity.com/profiles/76561198443698198/', 'https://steamcommunity.com/profiles/76561199561717364/', 'https://steamcommunity.com/profiles/76561199025455931/', 'https://steamcommunity.com/profiles/76561199130782857/', 'https://steamcommunity.com/profiles/76561198851941619/', 'https://steamcommunity.com/profiles/76561198863452313/', 'https://steamcommunity.com/profiles/76561199688605425/', 'https://steamcommunity.com/profiles/76561199784796176/', 'https://steamcommunity.com/profiles/76561198805682617/', 'https://steamcommunity.com/profiles/76561199775465188/', 'https://steamcommunity.com/profiles/76561198885396150/', 'https://steamcommunity.com/profiles/76561199521369287/', 'https://steamcommunity.com/profiles/76561198851122601/', 'https://steamcommunity.com/profiles/76561199431707331/', 'https://steamcommunity.com/profiles/76561199734698090/', 'https://steamcommunity.com/profiles/76561199770456826/', 'https://steamcommunity.com/profiles/76561198834447965/', 'https://steamcommunity.com/profiles/76561198297486233/', 'https://steamcommunity.com/profiles/76561199495175662/', 'https://steamcommunity.com/profiles/76561199783306321/', 'https://steamcommunity.com/profiles/76561198054804045/', 'https://steamcommunity.com/profiles/76561197987553341/', 'https://steamcommunity.com/profiles/76561198851755997/', 'https://steamcommunity.com/profiles/76561198221244488/', 'https://steamcommunity.com/profiles/76561198096367962/', 'https://steamcommunity.com/profiles/76561197971789512/', 'https://steamcommunity.com/profiles/76561199791223049/', 'https://steamcommunity.com/profiles/76561199496961338/', 'https://steamcommunity.com/profiles/76561199021027394/', 'https://steamcommunity.com/profiles/76561199099088245/', 'https://steamcommunity.com/profiles/76561199685367832/', 'https://steamcommunity.com/profiles/76561199603127312/', 'https://steamcommunity.com/profiles/76561199681501766/' ]; 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);