image view fit-height furaffinity.net

make the submission image fit the height of the screen

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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');