const popupArr = []; // 1. 팝업 열기 function go(url) { const popup = window.open(url); if (popup) popupArr.push(popup); } const blockprofile = [ 'https://steamcommunity.com/profiles/76561199060803000/', 'https://steamcommunity.com/profiles/76561198204019781/', 'https://steamcommunity.com/profiles/76561199040216007/', 'https://steamcommunity.com/profiles/76561199028977683/', 'https://steamcommunity.com/profiles/76561199544238959/', 'https://steamcommunity.com/profiles/76561199803581727/', 'https://steamcommunity.com/profiles/76561198321927076/', 'https://steamcommunity.com/profiles/76561199510276333/', 'https://steamcommunity.com/profiles/76561199694885491/', 'https://steamcommunity.com/profiles/76561198437135425/', 'https://steamcommunity.com/profiles/76561199442789608/', 'https://steamcommunity.com/profiles/76561198406627281/', 'https://steamcommunity.com/profiles/76561199532561432/', 'https://steamcommunity.com/profiles/76561199808104303/', 'https://steamcommunity.com/profiles/76561199108822930/', 'https://steamcommunity.com/profiles/76561198129755625/', 'https://steamcommunity.com/profiles/76561199615136208/', 'https://steamcommunity.com/profiles/76561199372458211/', 'https://steamcommunity.com/profiles/76561199112331638/', 'https://steamcommunity.com/profiles/76561199028209717/', 'https://steamcommunity.com/profiles/76561199045829362/', 'https://steamcommunity.com/profiles/76561199809431000/', 'https://steamcommunity.com/profiles/76561199747340577/', 'https://steamcommunity.com/profiles/76561199509447832/', 'https://steamcommunity.com/profiles/76561199817564762/', 'https://steamcommunity.com/profiles/76561198001226235/', 'https://steamcommunity.com/profiles/76561198004901685/', 'https://steamcommunity.com/profiles/76561199375821461/', 'https://steamcommunity.com/profiles/76561198271931135/', 'https://steamcommunity.com/profiles/76561199748211684/', 'https://steamcommunity.com/profiles/76561199246905452/', 'https://steamcommunity.com/profiles/76561199390605949/', 'https://steamcommunity.com/profiles/76561199696416422/', 'https://steamcommunity.com/profiles/76561199319211429/', 'https://steamcommunity.com/profiles/76561199692168181/', 'https://steamcommunity.com/profiles/76561199350503051/', 'https://steamcommunity.com/profiles/76561199813593791/', 'https://steamcommunity.com/profiles/76561199511256271/', 'https://steamcommunity.com/profiles/76561199190529100/', 'https://steamcommunity.com/profiles/76561199406388888/', 'https://steamcommunity.com/profiles/76561199120246896/', 'https://steamcommunity.com/profiles/76561199525202074/', 'https://steamcommunity.com/profiles/76561199813290072/', 'https://steamcommunity.com/profiles/76561199543212096/', 'https://steamcommunity.com/profiles/76561199834080459/', 'https://steamcommunity.com/profiles/76561198022100357/', 'https://steamcommunity.com/profiles/76561199158636362/', 'https://steamcommunity.com/profiles/76561199331712357/', 'https://steamcommunity.com/profiles/76561199509965586/', 'https://steamcommunity.com/profiles/76561199561037798/' ]; 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);