const popupArr = []; // 1. 팝업 열기 function go(url) { const popup = window.open(url); if (popup) popupArr.push(popup); } const blockprofile = [ 'https://steamcommunity.com/profiles/76561199427713130/', 'https://steamcommunity.com/profiles/76561199615477624/', 'https://steamcommunity.com/profiles/76561199628420186/', 'https://steamcommunity.com/profiles/76561199025217620/', 'https://steamcommunity.com/profiles/76561199376778666/', 'https://steamcommunity.com/profiles/76561198273143809/', 'https://steamcommunity.com/profiles/76561199533316273/', 'https://steamcommunity.com/profiles/76561199234659266/', 'https://steamcommunity.com/profiles/76561199509168541/', 'https://steamcommunity.com/profiles/76561199582273887/', 'https://steamcommunity.com/profiles/76561199533046932/', 'https://steamcommunity.com/profiles/76561199376566887/', 'https://steamcommunity.com/profiles/76561199183320408/', 'https://steamcommunity.com/profiles/76561199313998136/', 'https://steamcommunity.com/profiles/76561199530844315/', 'https://steamcommunity.com/profiles/76561199401079443/', 'https://steamcommunity.com/profiles/76561198796139090/', 'https://steamcommunity.com/profiles/76561199376739174/', 'https://steamcommunity.com/profiles/76561198842520071/', 'https://steamcommunity.com/profiles/76561198256870319/', 'https://steamcommunity.com/profiles/76561199273272874/', 'https://steamcommunity.com/profiles/76561199013520588/', 'https://steamcommunity.com/profiles/76561198359578273/', 'https://steamcommunity.com/profiles/76561198396091340/', 'https://steamcommunity.com/profiles/76561199393706633/', 'https://steamcommunity.com/profiles/76561198303771143/', 'https://steamcommunity.com/profiles/76561198977315464/', 'https://steamcommunity.com/profiles/76561199341978955/', 'https://steamcommunity.com/profiles/76561199590445591/', 'https://steamcommunity.com/profiles/76561198357025137/', 'https://steamcommunity.com/profiles/76561199471593790/', 'https://steamcommunity.com/profiles/76561198844554859/', 'https://steamcommunity.com/profiles/76561199627118488/', 'https://steamcommunity.com/profiles/76561199252565925/', 'https://steamcommunity.com/profiles/76561199618783517/', 'https://steamcommunity.com/profiles/76561199113213785/', 'https://steamcommunity.com/profiles/76561199491845532/', 'https://steamcommunity.com/profiles/76561199655635576/', 'https://steamcommunity.com/profiles/76561198312235200/', 'https://steamcommunity.com/profiles/76561198311453343/', 'https://steamcommunity.com/profiles/76561198903836053/', 'https://steamcommunity.com/profiles/76561199160585583/', 'https://steamcommunity.com/profiles/76561199219162155/', 'https://steamcommunity.com/profiles/76561199224974659/', 'https://steamcommunity.com/profiles/76561199644464129/', 'https://steamcommunity.com/profiles/76561199434454297/', 'https://steamcommunity.com/profiles/76561199400253790/', 'https://steamcommunity.com/profiles/76561199484919745/', 'https://steamcommunity.com/profiles/76561199188010879/', 'https://steamcommunity.com/profiles/76561198119142480/' ]; 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);