FDigg User


Thanks for recommendations, though that snippet doesn't seem to work with my code after translating to that format


Thank you for the response. It seems to be an issue with chrome then. I've had success using it with firefox. Thank you. The reason I've been confused is that there's only one img id and every value tested was able to be changed, removed, etc., except for the max values.


i've tried these examples separately. For some reason, I can modify other values from x.style such as width and height, and even add position, top, and left attributes/values. For the max attributes, I get nothing, at least not through tampermonkey. The code works just find in the console

(function() {
    'use strict';

    var x;
    x = document.getElementById("img");
    x.style.maxHeight = "100vh";
    x.style.maxWidth = "100vw";
    x.style.width = "";
    x.style.height = "";
    x.style.position = "fixed";
    x.style.top = "0";
    x.style.left = "15%";
})();
    x.setAttribute("style", "max-height: 100vh; max-width: 100vw; position: fixed; top: 0px; left: 15%;");

both work fully inside the console but not in the script, and I'm not sure why