Extensions :  K-Meleon Forum
All about K-Meleon extensions. 
Missing-images Display Fix for KM1.6 (Gecko 1.9)
Posted by: siria
Date: August 27, 2010 05:40AM

Perhaps you haven't noticed yet, but Gecko-Browsers like K-Meleon tend to completely hide missing images from you, IF their dimensions are not given in the page code, so depending on your settings, you may not even get the idea you might be missing an image or anything at all there. This goes for example for all the images posted in this forum, and most other forums too, and normal sites too of course, but there it depends on the webmaster, if he has written the image size into the code or not.

Here is a fix, only for KM1.6!
This is basically a far smaller version of my macro for KM1.5.x, which just isn't quite finished yet. But in KM1.6 there is a new pseudo-class introduced by Gecko, which makes that no macro is needed anymore, only a bit of CSS code.
You may add this code either to your AdBlock.css in your profile folder, that sheet can be toggled on/off while the browser keeps running.
If you prefer you can alternatively add that stuff to your userContent.css, but then changes require a browser restart, and I'm not sure at all if it still works there if you manually switch on the "Block-like placeholders" in the Preferences for images. Sounds paradox, but they should stay off for this fix.

Tested on these pages:
KM-Forum cool smiley
https://bug58646.bugzilla.mozilla.org/attachment.cgi?id=72516
http://lab.gmtplusone.com/image-placeholder/
http://mrs260.fenfanfair.com/folder/scorpio.html


/* =============== BROKEN IMAGES - show all in KM1.6 (Gecko 1.9) =================

Recommended prefs in F2 > Page Display > Images: 1) Icons ON 3) Placeholders OFF!!
The "placeholder" pref decides whether you can see at least the Alt-Text, if an image has no size!
Add this code to Edit > Configuration > AdBlock Stylesheet.
Toggle AdBlock sheet on and off in Tools > Privacy. Test it on KM-forum or on these pages:
https://bug58646.bugzilla.mozilla.org/attachment.cgi?id=72516
http://lab.gmtplusone.com/image-placeholder/
http://mrs260.fenfanfair.com/folder/scorpio.html */

/* Image size is known from the page code? Show that real size as placeholder: */
img[width]:-moz-broken ,
img[width]:-moz-user-disabled {
-moz-force-broken-image-icon: 1 !important;
}

/* Image size unknown? Show no icon but Alt-Text. Put a little border around it as marker */
img:-moz-broken:not([width]),
img:-moz-user-disabled:not([width]) {
-moz-force-broken-image-icon: 0 !important;
border: 1px solid !important;
border-color: green gold orange blue !important;
}

/* Image size unknown, and no Alt-Text either? Show a 24px placeholder, keep border: */
img:-moz-broken:not([width]):not([alt]),
img:-moz-user-disabled:not([width]):not([alt]) ,
img[alt=""]:-moz-broken:not([width]) ,
img[alt=""]:-moz-user-disabled:not([width]) {
-moz-force-broken-image-icon: 1 !important;
width: 24px !important;
height: 24px !important;
}

/* ================================ */


Hmm... perhaps I'll still put it into a litte macro, with a menu toggle, will see.
It IS a bit abusing the adblock-sheet here, so that may be confusing to less experienced users tongue sticking out smiley



Edited 2 time(s). Last edit at 08/27/2010 06:13AM by siria.

Options: ReplyQuote
Re: Missing-images Display Fix for KM1.6 (Gecko 1.9)
Posted by: jsnj
Date: August 27, 2010 07:16AM

Ironically I discovered this problem today while trying to take an online pole. The vote box didn't exist until your fix. Thanks!

Options: ReplyQuote
Re: Missing-images Display Fix for KM1.6 (Gecko 1.9)
Posted by: desga2
Date: August 28, 2010 12:13AM

@ siria:
Are you sure that images with width, but without height, works with your current code?

K-Meleon in Spanish

Options: ReplyQuote
Re: Missing-images Display Fix for KM1.6 (Gecko 1.9)
Posted by: siria
Date: August 28, 2010 03:02AM

Quote
jsnj
Ironically I discovered this problem today while trying to take an online pole. The vote box didn't exist until your fix. Thanks!

LOL, what a timing!! grinning smiley Glad you like it smiling smiley
And this "didn't exist" thing is exactly where the problem lies, sigh.

Quote
desga2
Are you sure that images with width, but without height, works with your current code?

Of course I'm sure that they do NOT cool smiley But that makes the code really more complicated and longer, and how many images may there be out there, with either only height or only width in the code? That's the question... Except for the very rare guys who are actually html-coding in text editors that can almost not happen, and those guys sure know what they are doing, except for rare glitches. But the widespread wysiwyg programs and online editors, those that I've seen all fill in the size either automatically, both width and hight, or none at all.
Anyway, with or without the height, both ways have their pro's and con's. But okay, there IS a tiny risk, and I'll post also a version with the height in it, some time soon... ;-)

At the moment can't stop playing with those styles yet, in my KM1.5 macro, have now a nice red-cross minicon put before the sizeless alt-text images, and now am struggling with a BLUE mini-icon for linked ones... Oh well, as usual nothing works at first, but as usual I hope to get there, slowly but surely tongue sticking out smiley

Options: ReplyQuote
Re: Missing-images Display Fix for KM1.6 (Gecko 1.9)
Posted by: desga2
Date: August 28, 2010 04:23AM

Quote
siria
Of course I'm sure that they do NOT cool smiley But that makes the code really more complicated and longer, and how many images may there be out there, with either only height or only width in the code? That's the question... Except for the very rare guys who are actually html-coding in text editors that can almost not happen, and those guys sure know what they are doing, except for rare glitches. But the widespread wysiwyg programs and online editors, those that I've seen all fill in the size either automatically, both width and hight, or none at all.
Anyway, with or without the height, both ways have their pro's and con's. But okay, there IS a tiny risk, and I'll post also a version with the height in it, some time soon... ;-)

I must be one of this "rare guys", because when my companions don't know why his HTML builded with "wysiwyg programs" or "online editors" don't work they come to ask me.
They don't know how work the code only known drag&drop items in a GUI.

If we could change two dummy for one smart, the world would be a better world. smiling smiley

Don't try too much, no one uses KM 1.5.x when we'll released KM 1.6. tongue sticking out smiley
Ups... "Except for the very rare guys who are ..." using Win9x. tongue sticking out smiley

This is your code with "height" value, is it correct? can you test it?


/* =============== BROKEN IMAGES - show all in KM1.6 (Gecko 1.9) =================
*
Recommended prefs in F2 > Page Display > Images: 1) Icons ON 3) Placeholders OFF!!
The "placeholder" pref decides whether you can see at least the Alt-Text, if an image has no size!
Test it on KM-forum or on these pages:
https://bug58646.bugzilla.mozilla.org/attachment.cgi?id=72516
http://lab.gmtplusone.com/image-placeholder/
http://mrs260.fenfanfair.com/folder/scorpio.html
*/

/* Image size is known from the page code? Show that real size as placeholder: */
img[width]:-moz-broken,
img[height]:-moz-broken,
img[width]:-moz-user-disabled,
img[height]:-moz-user-disabled {
-moz-force-broken-image-icon: 1 !important;
}

/* Image size unknown? Show no icon but Alt-Text. Put a little border around it as marker */
img:-moz-broken:not([width]),
img:-moz-broken:not([height]),
img:-moz-user-disabled:not([width]),
img:-moz-user-disabled:not([height]) {
-moz-force-broken-image-icon: 0 !important;
border: 1px solid !important;
border-color: green gold orange blue !important;
}

/* Image size unknown, and no Alt-Text either? Show a 24px placeholder, keep border: */
img:-moz-broken:not([width]):not([alt]),
img:-moz-broken:not([height]):not([alt]),
img:-moz-user-disabled:not([width]):not([alt]),
img:-moz-user-disabled:not([height]):not([alt]),
img[alt=""]:-moz-broken:not([width]),
img[alt=""]:-moz-broken:not([height]),
img[alt=""]:-moz-user-disabled:not([width]),
img[alt=""]:-moz-user-disabled:not([height]) {
-moz-force-broken-image-icon: 1 !important;
width: 24px !important;
height: 24px !important;
}

/* ================================ */ 

K-Meleon in Spanish



Edited 2 time(s). Last edit at 08/28/2010 04:26AM by desga2.

Options: ReplyQuote
Re: Missing-images Display Fix for KM1.6 (Gecko 1.9)
Posted by: siria
Date: August 28, 2010 05:58AM

grinning smiley I'm not surprised that you're hand-coding, but that's exactly my point - they all come to you, because they all aren't doing it that way.

Actually I've started trying a special mini-icon for zero-pics, and really, really like that look much better now! Started playing with it when i stumbled across another css trick on the opera pages, and as a surprising side effect it seems to greatly simplify the code too, it's much smaller now, and only 1x checking for a size! :-))

Quote
desga
/* Image size is known from the page code? Show that real size as placeholder: */
img[width]:-moz-broken,
img[height]:-moz-broken,
img[width]:-moz-user-disabled,
img[height]:-moz-user-disabled {
-moz-force-broken-image-icon: 1 !important;
}

Just a quick look, because I'll probably drop that "version-1" way, but lets say, a "bad" image which has a width but no height, or a height without width - that qualifies here. As well as a "good" image that has both width and height and isn't vanishing normally - it qualifies too cool smiley
Meanwhile I've noticed it could be written
img[width][height]:-moz-broken,
to require both. But wouldn't be so easy to add for the lines further down.

But my "version-2" will be coming soon, and so far it needs only a single size check...

Options: ReplyQuote
Re: Missing-images Display Fix for KM1.6 (Gecko 1.9)
Posted by: Doon
Date: August 31, 2010 03:35PM

Nice work Siria. I hope to check out your 1.5.x macro when it becomes available. I still wish 'block images' had an option to leave placeholders, which could then be loaded with a right-click as desired, which is something I did all the time with IE5.



Edited 1 time(s). Last edit at 09/23/2010 07:32AM by Doon.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.