Skip to content

Instantly share code, notes, and snippets.

@marsa099
Last active January 31, 2025 04:00
Show Gist options
  • Save marsa099/bc4f29539459929b58906af0ce1ac6e0 to your computer and use it in GitHub Desktop.
Save marsa099/bc4f29539459929b58906af0ce1ac6e0 to your computer and use it in GitHub Desktop.
Paste this in chrome dev tools console to simulate mouse movement every 5 sec
// Open Developer Tools in the Microsoft Teams tab,
// paste this code in the Console, and press Enter to simulate activity.
// Make sure you allow pasting. You will get a warning if pasting is disabled
// Stop script by setting keepAlive = false
let keepAlive = true;
function simulateMouseMove() {
if (!keepAlive) return;
const event = new MouseEvent('mousemove', {
bubbles: true,
cancelable: true,
clientX: Math.random() * window.innerWidth,
clientY: Math.random() * window.innerHeight,
});
console.log("Movement");
document.dispatchEvent(event);
}
setInterval(simulateMouseMove, 5000);
function stopKeepAlive() {
keepAlive = false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment