Skip to content

Instantly share code, notes, and snippets.

@381sm016
Created November 10, 2025 15:07
Show Gist options
  • Select an option

  • Save 381sm016/0d8eb950ad9f42431f0b04937419e7e9 to your computer and use it in GitHub Desktop.

Select an option

Save 381sm016/0d8eb950ad9f42431f0b04937419e7e9 to your computer and use it in GitHub Desktop.
Bypass voor TOA tab detectie
// ==UserScript==
// @name TOA Test - Disable Tab Detection
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Laat TOA denken dat hij altijd openstaat doormiddel van de webkitvisibilitychange en visibilitychange events te blokkeren
// @author 381sm016
// @match https://toa.toets.nl/*
// @grant none
// @run-at document-start
// ==/UserScript==
(function() {
'use strict';
console.log('TOA Tab Detection Bypass: Active');
// overrides API
Object.defineProperty(document, 'hidden', {
configurable: false,
get: function() { return false; }
});
Object.defineProperty(document, 'visibilityState', {
configurable: false,
get: function() { return 'visible'; }
});
// block visibilitychange events
document.addEventListener('visibilitychange', function(e) {
console.log('Blocked visibilitychange event');
e.stopImmediatePropagation();
}, true);
document.addEventListener('webkitvisibilitychange', function(e) {
console.log('Blocked webkitvisibilitychange event');
e.stopImmediatePropagation();
}, true);
// blurevent block
window.addEventListener('blur', function(e) {
console.log('Blocked blur event');
e.stopImmediatePropagation();
}, true);
// Keep focus events working normally
window.addEventListener('focus', function(e) {
console.log('Focus event (normal)');
}, true);
console.log('TOA Tab Detection Bypass: Setup Complete');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment