Created
June 9, 2026 11:22
-
-
Save PAEz/7dcadb7e77fc6b61661f3c9a252c5d6b to your computer and use it in GitHub Desktop.
Hijack the mic and pass in a screen/tab captures audio instead
This file contains hidden or 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
| /* | |
| Add this to what ever and when it tries to connect with the mic it will connect with screen/tab sharing instead | |
| and can pipe its audio into whatever instead. On linux you'll only be able to stream the audio of another tab, | |
| but on windows you can pick screen plus audio and get the full system audio...sweet!!!! | |
| */ | |
| // Overwrite the browser's microphone API right on the webpage | |
| navigator.mediaDevices.getUserMedia = async function(constraints) { | |
| if (constraints && constraints.audio) { | |
| console.log("Intercepted OpenProcessing mic request! Diverting to system audio..."); | |
| try { | |
| // Prompt the user for system audio instead of the microphone | |
| let stream = await navigator.mediaDevices.getDisplayMedia({ | |
| video: true, // Required by Chrome to trigger the prompt | |
| audio: { systemAudio: "include" } | |
| }); | |
| return stream; | |
| } catch(e) { | |
| console.error("User denied system audio sharing.", e); | |
| } | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment