Imgur auto resize

Automatically resizes imgur videos to fit the screen height

目前为 2021-10-31 提交的版本。查看 最新版本

// ==UserScript==
// @name         Imgur auto resize
// @namespace    https://github.com/NotJ3st3r
// @version      1.0
// @description  Automatically resizes imgur videos to fit the screen height
// @author       https://github.com/NotJ3st3r
// @match        https://i.imgur.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    addGlobalStyle('body { overflow: hidden !important; }');
    var video = document.getElementsByTagName('video');
    video[0].style.height = "100vh";
    video[0].style.width = "auto";
})();

function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址