Last active
July 24, 2022 19:55
-
-
Save hobgoblina/8024db5a3ce16b3c78b579ced0344c51 to your computer and use it in GitHub Desktop.
Gitpod Tampermonkey script for Full Screen & Fira Code
This file contains hidden or 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
// ==UserScript== | |
// @name Gitpod Fullscreen | |
// @namespace https://gitpod.io/ | |
// @version 0.1 | |
// @description Make Gitpod fullscreen, for Android-based development | |
// @author Lina | |
// @match https://*.gitpod.io/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=gitpod.io | |
// @grant GM_getResourceText | |
// @grant GM_addStyle | |
// @resource FIRA_CSS https://gist.githubusercontent.com/necropolina/1144fc52bbc03a72b257cc8533110eaf/raw/1587eff7cb29f32173b20db00e7eea75a1e800a4/fira-code.css | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// Import the Fira Code font stylesheet | |
const fira = GM_getResourceText("FIRA_CSS"); | |
GM_addStyle(fira); | |
// Request fullscreen mode on click/tap | |
const setFullScreen = () => { | |
const el = document.querySelector('.monaco-workbench'); | |
const func = el.requestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen || el.webkitRequestFullScreen; | |
if (func) { | |
func.call(el); | |
} | |
} | |
document.onclick = setFullScreen; | |
document.ontouchstart = setFullScreen; | |
document.ontouchend = setFullScreen; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment