image view fit-height furaffinity.net

make the submission image fit the height of the screen

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==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');