谷歌浏览器页面迁移后无法关闭

先上代码,我不会!
以下a页面点击链接跳转到b页面,点击b页面的链接关闭当前窗体
请问我该怎么办?
求助社区大神
我的目的只有一个 {关闭chrome浏览器当前窗体}

a.html
<html><head>
</head><body>
<a href="b.html" >关闭当前窗体</a>
</body></html>
b.html
<html><head>
<script>
function test(){
}
</script>
</head><body bgcolor="#EBC79E">
<h3>Frame B</h3>
<a href="javascript:test()" >关闭当前窗体</a>
</body></html>
window.close();

a.html
<html><head>
</head><body>
<a href="b.html" target="_self">关闭当前窗体</a>
</body></html>
b.html
<html><head>
<script>
function test(){
window.opener=null;
window.close();
}
</script>
</head><body bgcolor="#EBC79E">
<h3>Frame B</h3>
<a href="javascript:test()" >关闭当前窗体</a>
</body></html>

你好,根据你的需求,已经成功的做好demo,

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button onclick="closePage()"> 关闭</button>
<script>
    function closePage() {
        if (navigator.userAgent.indexOf("Chrome") != -1) {
            window.location.href = "about:blank";
            window.close();
        }
    }
</script>
</body>
</html>

谷歌浏览器应为安全机制,脚本只能关闭脚本打开的页面,所以需要先用js脚本打开一次页面在关闭.我这边已经完美复现你的功能,请你采纳一下.谢谢,有问题可以继续问我

你这是自己的奇思妙想吧,一般公司没有这种需求
可以明确告诉你,这是无法实现的。js无法跨域控制网页

浏览器好像是禁止这种操作的,最多做到把当前的打开的网页变成空白页,不可以直接关闭