Try this ui_template. Use at your own risk.
[{"id":"911e3d0e.7d6e9","type":"ui_template","z":"9d1b14cfb6a1526e","group":"325714454937adc5","name":"Close Current Browser Window","order":2,"width":0,"height":0,"format":"<script>\nvar elem = document.documentElement;\n\nthis.scope.action = function closeWindowWithConfirmation() {\nif (confirm(\"Are you sure you want to close the window?\")) {\nwindow.close();\n}\n}\n\ndocument.getElementById(\"close-button\").onclick = closeWindowWithConfirmation;\n\n</script>\n<md-button ng-click=\"send({payload:action()})\">\n Close Window\n</md-button>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","className":"","x":530,"y":160,"wires":[[]]},{"id":"325714454937adc5","type":"ui_group","name":"DEMO","tab":"fb48ae21810a7ddc","order":2,"disp":false,"width":"25","collapse":false,"className":""},{"id":"fb48ae21810a7ddc","type":"ui_tab","name":"TEST","icon":"dashboard","order":7,"disabled":false,"hidden":false}]
Inspired by this earlier post...