Skip to content

Instantly share code, notes, and snippets.

@nathan130200
Created September 13, 2022 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathan130200/10f6ad3f885f78da84317d72faf6e834 to your computer and use it in GitHub Desktop.
Save nathan130200/10f6ad3f885f78da84317d72faf6e834 to your computer and use it in GitHub Desktop.
Xcloud on browser - Set game video to fill browser area.
// ==UserScript==
// @name Fill Xcloud Video Screen
// @author FRNathan13
// @match https://www.xbox.com/pt-BR/play/launch/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=xbox.com
// @grant none
// @version 1.0
// ==/UserScript==
(function() {
'use strict';
var timer = -1;
timer = setInterval(() => {
try {
var arr = [...document.querySelectorAll('video')];
for(let el of arr) {
if(el.style && el.style.objectFit) {
if(el.style.objectFit != 'fill'){
el.style.objectFit = 'fill';
console.info('[Fill Xcloud Video Screen] Element style set to fill content.');
}
}
}
}
catch(e) {
// ignore
}
}, 1000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment