Close the current page

function closeWindow(){ var userAgent = navigator.userAgent; if (userAgent.indexOf("Firefox") ! = -1 || userAgent.indexOf("Chrome") ! =-1) { window.location.href="about:blank"; window.close(); } else { window.opener = null; window.open("", "_self"); window.close(); }}Copy the code

Or just write it like this (ie tests can also be turned off) :

window.open("about:blank","_self").close()  
Copy the code

The problem is that when using vue+ Chrome, some Chrome versions automatically jump to the About :blank page and cannot close the current page.