image view fit-height furaffinity.net

make the submission image fit the height of the screen

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        image view fit-height furaffinity.net
// @namespace   Violentmonkey Scripts
// @match       https://www.furaffinity.net/view*
// @grant       none
// @version     1.2.0
// @author      justrunmyscripts
// @license     MIT
// @description make the submission image fit the height of the screen
// ==/UserScript==
const element = document.querySelector('#submissionImg');
element.setAttribute('style', `
  max-height: calc(100vh - 110px);
`);

// NOTE: while this _does_ technically remove an ad
// which shouldn't be the responsibility of this script
// (get an ad blocker instead)
// this one ad still takes up a lot of vertial
// viewport space, pushing the main submission down...
const ad_el = document.querySelector('.leaderboardAd');
ad_el.remove();

// try to preserve system message, but move it to unused part of page header
// that way we free up even more vertial space.
let system_message_element = document.querySelector('.news-block');
let system_message = system_message_element.innerText;
system_message_element.remove();
let message_bar_desktop_element = document.querySelector('#ddmenu .message-bar-desktop');
message_bar_desktop_element.innerText = system_message;
message_bar_desktop_element.setAttribute('style', 'user-select: text;');

let header_element = document.querySelector('#header.has-adminmessage');
header_element.removeClassName('has-adminmessage');