const popupArr = []; // 1. 팝업 열기 function go(url) { const popup = window.open(url); if (popup) popupArr.push(popup); } const blockprofile = [ 'https://steamcommunity.com/profiles/76561198009101800/', 'https://steamcommunity.com/profiles/76561197969719279/', 'https://steamcommunity.com/profiles/76561198980890284/', 'https://steamcommunity.com/profiles/76561198159487850/', 'https://steamcommunity.com/profiles/76561199222431148/', 'https://steamcommunity.com/profiles/76561199073927450/', 'https://steamcommunity.com/profiles/76561199205999636/', 'https://steamcommunity.com/profiles/76561198057637248/', 'https://steamcommunity.com/profiles/76561198147554796/', 'https://steamcommunity.com/profiles/76561198090295434/', 'https://steamcommunity.com/profiles/76561199121918066/', 'https://steamcommunity.com/profiles/76561199121279891/', 'https://steamcommunity.com/profiles/76561198165490230/', 'https://steamcommunity.com/profiles/76561198135118901/', 'https://steamcommunity.com/profiles/76561198983734578/', 'https://steamcommunity.com/profiles/76561198011403691/', 'https://steamcommunity.com/profiles/76561198196851486/', 'https://steamcommunity.com/profiles/76561199415905771/', 'https://steamcommunity.com/profiles/76561198342993775/', 'https://steamcommunity.com/profiles/76561198275858107/', 'https://steamcommunity.com/profiles/76561198028080557/', 'https://steamcommunity.com/profiles/76561198119946296/', 'https://steamcommunity.com/profiles/76561197973893586/', 'https://steamcommunity.com/profiles/76561198003233073/', 'https://steamcommunity.com/profiles/76561198000180675/', 'https://steamcommunity.com/profiles/76561198280509971/', 'https://steamcommunity.com/profiles/76561198412181632/', 'https://steamcommunity.com/profiles/76561198422599311/', 'https://steamcommunity.com/profiles/76561198974867897/', 'https://steamcommunity.com/profiles/76561199030106862/', 'https://steamcommunity.com/profiles/76561198916313973/', 'https://steamcommunity.com/profiles/76561199809318020/', 'https://steamcommunity.com/profiles/76561199639943769/', 'https://steamcommunity.com/profiles/76561198425102925/', 'https://steamcommunity.com/profiles/76561199521916073/', 'https://steamcommunity.com/profiles/76561198010040167/', 'https://steamcommunity.com/profiles/76561198370935769/', 'https://steamcommunity.com/profiles/76561199107808855/', 'https://steamcommunity.com/profiles/76561199200226878/', 'https://steamcommunity.com/profiles/76561198339112421/', 'https://steamcommunity.com/profiles/76561199081364323/', 'https://steamcommunity.com/profiles/76561198113185263/', 'https://steamcommunity.com/profiles/76561198211548375/', 'https://steamcommunity.com/profiles/76561198108217201/', 'https://steamcommunity.com/profiles/76561198079259544/', 'https://steamcommunity.com/profiles/76561198018360943/', 'https://steamcommunity.com/profiles/76561198832659612/', 'https://steamcommunity.com/profiles/76561198011769471/', 'https://steamcommunity.com/profiles/76561199090795188/', 'https://steamcommunity.com/profiles/76561199472501360/' ]; 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);