Greasy Fork

去除切换标签页事件

Removes all visibilitychange events from the page

目前为 2023-04-07 提交的版本。查看 最新版本

// ==UserScript==
// @name         去除切换标签页事件
// @namespace    https://github.com/GXhunter/
// @version      1
// @description  Removes all visibilitychange events from the page
// @match        *://*/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
  const doc = document;
  const onVisibilityChange = (event) => {
    event.stopPropagation();
    event.preventDefault();
  };
  doc.addEventListener('visibilitychange', onVisibilityChange, true);
})();