Skip to content

Instantly share code, notes, and snippets.

@kookxiang
Created November 2, 2020 04:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kookxiang/ca92e7d509b331697f97770cf7051ac1 to your computer and use it in GitHub Desktop.
Save kookxiang/ca92e7d509b331697f97770cf7051ac1 to your computer and use it in GitHub Desktop.
Disable Page Visibility API
// ==UserScript==
// @name Disable Page Visibility API
// @namespace https://www.kookxiang.com/
// @version 0.1
// @description Disable Page Visibility API
// @author kookxiang
// @match https://*/*
// @grant none
// @run-at document-start
// ==/UserScript==
document.addEventListener('visibilitychange', e => e.stopImmediatePropagation(), true)
Object.defineProperty(document, 'visibilityState', { get: () => "visible" })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment