Auto High-Res Cookie & Resize To Fullscreen

Automatically adds the "Always High Resolution" cookie and resizes the image to fit snugly in the client window so you don't have to scroll right.

  1. // ==UserScript==
  2. // @name Auto High-Res Cookie & Resize To Fullscreen
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Automatically adds the "Always High Resolution" cookie and resizes the image to fit snugly in the client window so you don't have to scroll right.
  6. // @author eM-Krow
  7. // @match *://rule34.xxx/*
  8. // @icon https://www.google.com/s2/favicons?domain=rule34.xxx
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. try {
  13. Cookie.create('resize-original',1); Cookie.create('resize-notification',1); Post.highres(); $('resized_notice').hide();
  14. } catch (e) {
  15. console.log("Image already high-res, cannot reset cookie...");
  16. }
  17. const autoResize = () => {
  18. do {
  19. document.getElementById("image").style = "position: absolute; left: 5px; width: 99%; height: auto;";
  20. } while (!document.getElementById("image").style == "position: absolute; left: 5px; width: 99%; height: auto;")
  21. };
  22. window.onload = autoResize();