iFunny Video Resize

Resizes videos on iFunny to match browser window height.

// ==UserScript==
// @name         iFunny Video Resize
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Resizes videos on iFunny to match browser window height.
// @author       Zeval
// @match        https://ifunny.co/video/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=ifunny.co
// @grant        none
// ==/UserScript==

(function () {
	'use strict';
	try {
		var vids = document.getElementsByTagName('video');
		console.log(vids);
		let headerHeight = 56;
		let newHeight = (window.innerHeight - headerHeight).toString() + 'px';

		if (!vids) return;
		// add top padding so video is not put behind header
		vids[0].parentElement.parentElement.parentElement.parentElement.parentElement.style.paddingTop =
			headerHeight.toString() + 'px';
		// resize vid
		vids[0].style.height = newHeight;
		// resize parent divs and comments
		vids[0].parentElement.style.height = newHeight;
		vids[0].parentElement.parentElement.style.height = newHeight;
		vids[0].parentElement.parentElement.parentElement.style.height = newHeight;
		vids[0].parentElement.parentElement.parentElement.parentElement.style.height = newHeight;
		vids[0].parentElement.parentElement.style.paddingTop = '0px';

		document.getElementById('comments').style.paddingTop = '170px';
	} catch (e) {
		console.error(e);
	}
})();