Last active
August 11, 2023 12:19
-
-
Save Alkarex/6dd74cde31568c02f46ac37aab773509 to your computer and use it in GitHub Desktop.
Greasemonkey user script to stop Web page visibility tracking (e.g. forcing a video to stop if its tab is not in focus)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Stop visibility tracking | |
// @namespace https://alexandre.alapetite.fr/ | |
// @description Stop Web page visibility tracking (e.g. forcing a video to stop if its tab is not in focus) | |
// @version 1.0 | |
// @grant none | |
// @match https://example.net/* | |
// ==/UserScript== | |
//NB: You should manually add the Web sites you want to target in your user-specific inclusion list. | |
window.addEventListener('visibilitychange', function (event) { event.stopImmediatePropagation(); }, true); | |
window.addEventListener('blur', function (event) { event.stopImmediatePropagation(); }, true); | |
window.addEventListener('mouseleave', function (event) { event.stopImmediatePropagation(); }, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment