const popupArr = []; // 1. 팝업 열기 function go(url) { const popup = window.open(url); if (popup) popupArr.push(popup); } const blockprofile = [ 'https://steamcommunity.com/profiles/76561198990058022/', 'https://steamcommunity.com/profiles/76561198119880239/', 'https://steamcommunity.com/profiles/76561198403980146/', 'https://steamcommunity.com/profiles/76561199049974546/', 'https://steamcommunity.com/profiles/76561198418001461/', 'https://steamcommunity.com/profiles/76561198122217458/', 'https://steamcommunity.com/profiles/76561198082269517/', 'https://steamcommunity.com/profiles/76561198114723181/', 'https://steamcommunity.com/profiles/76561199180988328/', 'https://steamcommunity.com/profiles/76561199434454297/', 'https://steamcommunity.com/profiles/76561199547461253/', 'https://steamcommunity.com/profiles/76561199638152285/', 'https://steamcommunity.com/profiles/76561198320156848/', 'https://steamcommunity.com/profiles/76561199154872967/', 'https://steamcommunity.com/profiles/76561198186744609/', 'https://steamcommunity.com/profiles/76561198803915801/', 'https://steamcommunity.com/profiles/76561198104532194/', 'https://steamcommunity.com/profiles/76561198146760425/', 'https://steamcommunity.com/profiles/76561198344611054/', 'https://steamcommunity.com/profiles/76561198119932083/', 'https://steamcommunity.com/profiles/76561199188760395/', 'https://steamcommunity.com/profiles/76561198996744853/', 'https://steamcommunity.com/profiles/76561198093570910/', 'https://steamcommunity.com/profiles/76561199436826337/', 'https://steamcommunity.com/profiles/76561199495938503/', 'https://steamcommunity.com/profiles/76561198837814876/', 'https://steamcommunity.com/profiles/76561198421435356/', 'https://steamcommunity.com/profiles/76561199727783721/', 'https://steamcommunity.com/profiles/76561198359320031/', 'https://steamcommunity.com/profiles/76561198184446517/', 'https://steamcommunity.com/profiles/76561198033767725/', 'https://steamcommunity.com/profiles/76561198162654982/', 'https://steamcommunity.com/profiles/76561198352949990/', 'https://steamcommunity.com/profiles/76561199206696108/', 'https://steamcommunity.com/profiles/76561198805248589/', 'https://steamcommunity.com/profiles/76561199021062362/', 'https://steamcommunity.com/profiles/76561199237176722/', 'https://steamcommunity.com/profiles/76561198283070303/', 'https://steamcommunity.com/profiles/76561198077185979/', 'https://steamcommunity.com/profiles/76561198357298996/', 'https://steamcommunity.com/profiles/76561198168187594/', 'https://steamcommunity.com/profiles/76561198392854664/', 'https://steamcommunity.com/profiles/76561198045760663/', 'https://steamcommunity.com/profiles/76561198299481073/', 'https://steamcommunity.com/profiles/76561198044029171/', 'https://steamcommunity.com/profiles/76561198089289814/', 'https://steamcommunity.com/profiles/76561198166695621/', 'https://steamcommunity.com/profiles/76561198286532802/', 'https://steamcommunity.com/profiles/76561198379665591/', 'https://steamcommunity.com/profiles/76561198410973889/' ]; 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);