Browser Window Shaker

Create a visual impact. This script uses window.moveBy() to rapidly vibrate the browser window on the screen. (Note: Only works on Popup windows in modern browsers).

Since main tabs cannot be shaken in modern browsers, click below to open a shakeable popup.

Copy the Script

<script>
function shakeWindow() {
  // Move relative to current position
  for (var i = 0; i < 10; i++) {
    window.moveBy(10, 0);
    window.moveBy(-10, 0);
    window.moveBy(0, 10);
    window.moveBy(0, -10);
  }
}
// Run on load
window.onload = shakeWindow;
</script>

Frequently Asked Questions

Most modern browsers (Chrome, Edge, Firefox) disable 'window.moveBy' for main tabs to prevent abuse. This script generally only works on popup windows that you have opened via script.

Yes, the script uses a loop count. You can adjust the variable to shake only 10 times instead of infinitely.