禁止标签页自动关闭

禁止标签页自动关闭的事件。

  1. // ==UserScript==
  2. // @name Disable tabs auto close
  3. // @name:zh-CN 禁止标签页自动关闭
  4. // @namespace https://greasyfork.org/zh-CN/users/193133-pana
  5. // @homepage https://www.sailboatweb.com
  6. // @version 1.0.0
  7. // @description Disable tabs auto close event.
  8. // @description:zh-CN 禁止标签页自动关闭的事件。
  9. // @author pana
  10. // @license GNU General Public License v3.0 or later
  11. // @match *://*/*
  12. // @grant none
  13. // @noframes
  14. // ==/UserScript==
  15.  
  16. (function () {
  17. 'use strict';
  18.  
  19. window.close = () => {
  20. console.warn('disabled window.close()');
  21. };
  22. })();