Lastorder-DC / chatreader-kor

채팅 읽어주는 로봇
https://lastorder.xyz/chatreader-kor/speech.html
MIT License
16 stars 11 forks source link

크롬 업데이트 후 CORB로 인해 사용 불가 #27

Closed rishubil closed 3 years ago

rishubil commented 3 years ago

아래와 같이 콘솔에 경고가 출력되고, 채팅 메시지를 받아올 수 없습니다.

Cross-Origin Read Blocking (CORB) blocked cross-origin response https://tmi.twitch.tv/group/user/fakechannel/chatters?oauth_token=faketoken&api_version=5&client_id=fakeid&callback=tapicJSONP667474423 with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details.
hyuntoe commented 3 years ago

아.. 저도 마찬가지 상황입니다.. ㅠㅠ

tapic.min.js:38 Cross-Origin Read Blocking (CORB) blocked cross-origin response https://tmi.twitch.tv/group/user/<채널아이디>/chatters?oauth_token=<토큰>&api_version=5&client_id=<아이디>&callback=<콜백> with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details. (anonymous) @ tapic.min.js:38 f @ tapic.min.js:47 (anonymous) @ tapic.min.js:48

trustkim commented 3 years ago

speech.html 코드 받고 tapic.js 받아서 해당 부분만 경로 수정해서 여러가지 테스트 해봤습니다.

tapic.js 에서

try { document.getElementById('tapicJsonpContainer').appendChild(node); } catch(e) { let tapicContainer = document.createElement('div'); tapicContainer.id = 'tapicJsonpContainer'; tapicContainer.style.cssText = 'display:none;'; document.getElementsByTagName('body')[0].appendChild(tapicContainer); tapicContainer.appendChild(node); }

구문 바로 위에(아마 379줄 쯤 될겁니다) type 속성 추가하니 CORB 문제는 없어졌던 것 같습니다.

if(node.src.startsWith("https://tmi")) { node.setAttribute('type','application/json'); }

근데 이젠 Cookie 설정에서 SameSite 문제가 발생하네요... 위에 타입 속성 추가한거 주석처리하고 다시 실행하니 CORB 문제가 또 안나오네요... 정확하게 뭐가뭔지 모르겠으나 참고하시라고 코멘트 남깁니다.

heartkim94 commented 3 years ago

tapic.js 파일 654라인을 let chatters = true;로 수정하여 강제로 true로 초기화하면 채널에 연결되고 채팅 메세지를 읽는 것을 확인했습니다.

737라인 ~ 759라인에서 chatters 정보를 받는데서 문제가 생긴것 같습니다.

위 방법으로 채널에 연결하긴 했으나 다른 기능에 영향없는지 확인하지 못했습니다.

Lastorder-DC commented 3 years ago

image 수정되었습니다. 문제 지속시 새로고침해주세요.