Client
-> Server
-> 3rd Party
써드파티의 response로 리디렉션이 있는데
새 탭이 팝업되는 것을 막기
window.close의 경우
보안상의 이유로 window.open으로 열린 창만 닫을 수 있다.
This method can only be called on windows that were opened by a script using the Window.open() method. If the window was not opened by a script, an error similar to this one appears in the console: Scripts may not close windows that were not opened by script.
...//리디렉션 되는 라우터라 가정
app.get("/redirect", () =>{
ctx.body = "<script>window.close();</script>"; // koa
//res.send("<script>window.close();</script>"); // express
})
https://developer.mozilla.org/en-US/docs/Web/API/Window/close