View Single Post
  #1  
Old 25.08.2020, 12:09
hairybadger's Avatar
hairybadger hairybadger is offline
Forum Veteran
 
Join Date: Dec 2013
Location: Geneva area
Posts: 544
Groaned at 2 Times in 2 Posts
Thanked 751 Times in 302 Posts
hairybadger has a reputation beyond reputehairybadger has a reputation beyond reputehairybadger has a reputation beyond reputehairybadger has a reputation beyond repute
FF: greasemonkey script to set max img width

Firefox only:



Something that has been bugging me forever is the width of images in englishforum: if a wide image is posted, I have to sideways-scroll to read the text in all the messages. Example:


https://www.englishforum.ch/internat...an-carlos.html



Yes, Firefox is always up-to-date. I've cobbled together an ugly-as-F greasemonkey script.


// ==UserScript==
// @name englishforum set max img width
// @version 1
// @grant none
// @namespace my.englishforum
// @include https://www.englishforum.ch/*html
// ==/UserScript==
var imgs = document.getElementsByTagName("img");

var length = imgs.length;

for(ii=0;ii< length;ii++){
setImgWidth(imgs[ii]);
}


function setImgWidth(img ) {
img.style.maxWidth = "900px";
}



Obviously there are other ways of doing it; this works for me.
__________________
La madre degli idioti sempre incinta
Reply With Quote
The following 4 users would like to thank hairybadger for this useful post: