Skip to content

Instantly share code, notes, and snippets.

@john-humi
Created June 15, 2021 19:31
Show Gist options
  • Save john-humi/81fe78fbb94c339e67120f6928fb9310 to your computer and use it in GitHub Desktop.
Save john-humi/81fe78fbb94c339e67120f6928fb9310 to your computer and use it in GitHub Desktop.
Google Meet FullScreen
javascript:(function()%7Bjavascript%3A (function() %7B%0A%0A let cleanFsBtns %3D () %3D> Array.from(document.getElementsByClassName('clickerMethodHandler')).forEach(e %3D> e.remove())%3B%0A%0A let clickerMethodHandle %3D function(video) %7B%0A let btn %3D document.createElement("span")%3B%0A btn.setAttribute('class'%2C 'clickerMethodHandler')%3B%0A btn.setAttribute('style'%2C "z-index%3A 999999999%3Bbackground%3A white%3Bwidth%3A 28px%3Bheight%3A 28px%3Bcontent%3A 'x'%3Bposition%3A absolute%3Bdisplay%3A block%3Bborder-radius%3A 14px%3Bmargin%3A 8px%3Bbackground-image%3A url('data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCI%2BDQogIDx0aXRsZT4NCiAgICBmdWxsc2NyZWVuDQogIDwvdGl0bGU%2BDQogIDxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTEgMXY2aDJWM2g0VjFIMXptMiAxMkgxdjZoNnYtMkgzdi00em0xNCA0aC00djJoNnYtNmgtMnY0em0wLTE2aC00djJoNHY0aDJWMWgtMnoiLz4NCjwvc3ZnPg0K')%3Bbackground-repeat%3A no-repeat%3Bbackground-position%3A center%3Bfilter%3A invert(1)%3B")%3B%0A if (video.style.display !%3D%3D "none") %7B%0A video.parentElement.parentElement.appendChild(btn)%3B%0A btn.addEventListener('click'%2C (event) %3D> %7B%0A video.requestFullscreen()%2C cleanFsBtns()%0A %7D)%3B%0A %7D%0A %7D%0A%0A Array.from(document.getElementsByTagName('video')).forEach((elem) %3D> clickerMethodHandle(elem))%0A%7D)()%7D)()%3B
javascript: (function() {
let cleanFsBtns = () => Array.from(document.getElementsByClassName('clickerMethodHandler')).forEach(e => e.remove());
let clickerMethodHandle = function(video) {
let btn = document.createElement("span");
btn.setAttribute('class', 'clickerMethodHandler');
btn.setAttribute('style', "z-index: 999999999;background: white;width: 28px;height: 28px;position: absolute;display: block;border-radius: 14px;margin: 8px;background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCI+DQogIDx0aXRsZT4NCiAgICBmdWxsc2NyZWVuDQogIDwvdGl0bGU+DQogIDxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTEgMXY2aDJWM2g0VjFIMXptMiAxMkgxdjZoNnYtMkgzdi00em0xNCA0aC00djJoNnYtNmgtMnY0em0wLTE2aC00djJoNHY0aDJWMWgtMnoiLz4NCjwvc3ZnPg0K');background-repeat: no-repeat;background-position: center;filter: invert(1);") if (video.style.display !== "none") {
video.parentElement.parentElement.appendChild(btn);
btn.addEventListener('click', (event) => {
video.requestFullscreen(), cleanFsBtns()
});
}
}
Array.from(document.getElementsByTagName('video')).forEach((elem) => clickerMethodHandle(elem))
})()
@webuniverseio
Copy link

Thanks for the idea 👏

@webuniverseio
Copy link

I added a couple of modifications here https://gist.github.com/webuniverseio/ef560b6e5fac189c9ced735228e99bef, buttons remain visible after full screen click. On full screen exist, button which was clicked is in focus. Tab button will first go through full screen buttons before other buttons, which already have shortcuts. On button focus there will be an outline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment