Created
February 7, 2022 08:11
-
-
Save fono09/ea16b9c45e6d48d255b642bbf33a5723 to your computer and use it in GitHub Desktop.
Join Meet Automatically
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
(function() { | |
Array.from(document.querySelectorAll('div[data-call-id]')).map(e => { | |
return { | |
'beginTime': new Date(parseInt(e.dataset.beginTime)), | |
'url': `https://meet.google.com/${e.dataset.callId}`, | |
} | |
}) | |
.filter(mtg => mtg.beginTime > Date.now()) // 過去のMTGには入らない | |
.map(mtg => { | |
const BeforeOffset = 5 * 60 * 1000 // 5分前には入る | |
const leaveMillSec = mtg.beginTime - Date.now() - BeforeOffset | |
setTimeout( | |
() => { | |
window.open(mtg.url, '_blank') | |
}, | |
leaveMillSec | |
) | |
const leaveSec = Math.floor(leaveMillSec / 1000) | |
console.log(`Meet ${mtg.url} will open in new tab after ${leaveSec}`) | |
}) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
meet.google.comで起動すると便利なはず。