// ==UserScript== // @name 去除切换标签页事件 // @namespace https://github.com/GXhunter/ // @version 1 // @description Removes all visibilitychange events from the page // @match *://*/* // @grant none // @license MIT // @downloadURL none // ==/UserScript== (function() { const doc = document; const onVisibilityChange = (event) => { event.stopPropagation(); event.preventDefault(); }; doc.addEventListener('visibilitychange', onVisibilityChange, true); })();