Close useless tabs in 163 mail

Close useless tabs

  1. // ==UserScript==
  2. // @name Close useless tabs in 163 mail
  3. // @namespace https://github.com/zklhp
  4. // @icon https://mail.163.com/favicon.ico
  5. // @version 3.3.0
  6. // @description Close useless tabs
  7. // @homepageURL https://gist.github.com/zklhp/c1a358f026358786bef58b49f65d8333
  8. // @author Chris Zheng <https://chriszheng.science/>
  9. // @match *://mail.163.com/*
  10. // ==/UserScript==
  11.  
  12. /* jshint esversion: 10 */
  13. (() => {
  14. var to_close = ["#_mail_link_2_135", "#_mail_link_2_137", "#_mail_link_4_125", "#_mail_link_3_122"];
  15.  
  16. for (let x of to_close) {
  17. try {
  18. document.querySelector(x).click();
  19. } catch {}
  20. }
  21. })();