Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Google Meet, open your video Picture in Picture mode #bookmarklet
javascript: void ((function(userName = 'You') {
/* More bookmarklets at */
function findUpElementByDataAttribute(element, attr) {
if (element) {
return element.dataset[attr] ? element : findUpElementByDataAttribute(element.parentElement, attr);
const usersElements = [...document.querySelectorAll('[data-initial-participant-id] [data-self-name]')];
const userElement = usersElements.find(e => e.textContent.toLowerCase().includes(userName.toLowerCase()));
const element = findUpElementByDataAttribute(userElement, 'initialParticipantId');
const videos = [...element?.querySelectorAll('video')];
const video = videos.find(v => !v.paused);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment