您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
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);
- }
- })();