The Screen Capture API allows web applications to capture the user’s screen, a specific application window, or a browser tab as a live MediaStream . This stream can then be:
mediaRecorder.start(1000); // Capture data every second startBtn.disabled = true; stopBtn.disabled = false;