Meet FulScreen

30.08.2021, 18:20:22

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Meet FulScreen
// @namespace   Violentmonkey Scripts
// *://*/*
// @match       https://meet.google.com/*
// @grant       none
// @version     1.1
// @author      -
// @description 30.08.2021, 18:20:22
// ==/UserScript==

let fullScreen = false

document.body.onkeydown = e => {
  const header = document.querySelector('[data-avatar-size="s"]')?.parentNode.parentNode.parentNode.parentNode
  const footer = document.querySelector('[data-capture-type]')?.parentNode.parentNode.parentNode.parentNode.parentNode
  const floater = header?.nextElementSibling.firstElementChild.firstElementChild
  const presentation = document.querySelector('[style="inset: 72px 16px 80px;"]')
  
  if (e.key === 'F' && e.ctrlKey && e.altKey && e.shiftKey) {
    if (fullScreen) {
      header.style.display = null
      footer.style.display = null
      floater.style.display = null
      presentation.style = 'inset: 72px 16px 80px;'
      
      fullScreen = false
      console.log('Monkey disables FullScreen')
    } else {
      header.style.display = 'none'
      footer.style.display = 'none'
      floater.style.display = 'none'
      presentation.style = 'height: 100%'
      
      fullScreen = true
      console.log('Monkey enables FullScreen')
    }
  }
}