javascript: var conf = confirm("Do you want to close this page?"); if(conf) {window.close()};
Why when i write this code in the url bar (chrome) it doesn't work, but it works through editor. And if i write only "javascript: close()" in the url bar it also works. Is it some of chrome restrictions or what? And the question is not 'how to close a tab', but why code doesn't work in the url bar. Thanks.