Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98b7348
commit 4a06f75
Showing
3 changed files
with
22 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* Maximize presentation with M-z. | ||
*/ | ||
document.addEventListener('keyup', (event) => { | ||
console.log(event) | ||
if (event.key === 'o' && event.altKey) { | ||
for (const elm of document.querySelectorAll('a')) { | ||
if (elm.textContent?.includes('New chat')) { | ||
elm.click() | ||
} | ||
} | ||
} | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,8 @@ | ||
import { click } from '../../util/dom' | ||
|
||
/** | ||
* Maximize presentation with M-z. | ||
*/ | ||
document.addEventListener('keydown', (event) => { | ||
document.addEventListener('keyup', (event) => { | ||
if (event.key === 'z' && event.altKey) { | ||
document.querySelector('[data-resolution-cap="0"]')?.requestFullscreen() | ||
} | ||
}) | ||
|
||
/** | ||
* Autojoin meeting. | ||
*/ | ||
const observer = new MutationObserver(async (mutations) => { | ||
for (const mutation of mutations) { | ||
if (mutation.target.textContent?.includes('Join now')) { | ||
// All mute. | ||
await click('[aria-label="Turn off microphone (ctrl + d)"]') | ||
await click('[aria-label="Turn off camera (ctrl + e)"]') | ||
;(mutation.target as HTMLButtonElement)?.click() | ||
setTimeout(() => { | ||
observer.disconnect() | ||
}, 3000) | ||
} | ||
} | ||
}) | ||
observer.observe(document.body, { | ||
attributes: true, | ||
childList: true, | ||
subtree: true, | ||
}) |