通常使用或window.open()打开一个新窗口,可以用window.close()方法关闭,但是当在新的window中调用location.hash的时候(比如:react-router的hashHistory),window.close()方法就会失效。解决方案:绕过location.hash方法,使用browserHistory或者其他路由方式。
location.hash导致window.close()失败相关文章