I am a little tired of catching another wizard’s creation from Mail.ru, I decided to write my own script that closes the page if the address contains go.mail. I downloaded tampermonkey, read manuals, JS remembered and made a simple check:

if (window.location.toString().indexOf("go.mail")!==-1){ window.close(); } 

It's simple, but it works on all sites except mail. And the condition comes in, if you put some alert there - everything will work, but window.close (), I think (because the web is not my profile), is caught by the site itself and chopped off.

Attention question: how to close a tab if its address contains "go.mail"?

  • location.hostname == 'go.mail.ru' ? The root window cannot be closed by a script, only those that were ... spawned :) "Scripts may be closed only." If you use browser extensions, you can create a lot there. And close, of course, too (if there is permission). - user207618 pm
  • that is, have to write your extension? I actually care about any other version of events that will solve my problem. - Turgor
  • Yep Chromium has a great and easy API for managing tabs, I didn’t really go into other browsers. - user207618

0