Development :  K-Meleon Forum
K-Meleon development related discussions. 
Who renders the icons?
Posted by: JohnHell
Date: March 13, 2017 11:24PM

This should be answered by a developer, and better by Dorian, but, do anyone know who renders the toolbars icons? K-meleon internal functions or the OS? (as looks system dependant)

The question is, of course, is there is some limit or odd displaying.

I'm asking because with all this story the last days about the icons and the toolbars for the flash toggling, I just asked myself (not the first time BTW), well, the skinning system provides a method to tell what is the size of an icon inside an image so it can be resampled/resized¹, so, why not distributing images at, for example,... 256x256? (icon size supported and preferred since Vista because of the higher DPI coming with the new screens).

I just tested and it looks fairly good even the resampling is at 16x (from 256 pixels to 16 pixels).

And, well, the biggest problem is the file size, obviously, but in PNG format isn't very dramatic for these days. About 100KB for a 3 icon set with quite a few white colors ratio (COLD, HOT, DEAD).

Even though I only tested one button, the memory consumption was the same (in my case 68MB with 75.0).

It is something that comes to my mind because if K-meleon or the system develops well, and looks like, I'd save tons of trials errors when trying to make icons looking good at 16x16. Really, is hardest than you could imagine. Pixel-art is an art ;)

What users think, starting by old users? What sizes do you use for icons or toolbars (independent values with old skinning¹)?

Would come the day when K-meleon or any other app would support vector graphics like SVG? That would be so time saving smiling smiley



¹ in the old skinning system through toolbars.cfg every button in a toolbar can set their own size; with new skinning system through skin.cfg all icons in an image are expected to have the same size.

Options: ReplyQuote
Re: Who renders the icons?
Posted by: rodocop
Date: March 14, 2017 12:13AM

I use ICO-files, storing multiple sizes in 1 file.
First I created this when found that KM pictire sizing isn't good enough for some fine details - it was icon set for Adblockcontrol macro by JamesD, that manages inbuilt adblock plugin.

But I had very different experience with them: firstly, I supposed that KM picks right icon size for corresponding toolbar size.

But then I found that it uses some particular size from that ico-set, but the selection principle is partly mysterious. Not always it's the biggest one - usually it's the size, that is read from ico-file as 'primary', read by OS.

(you can use Total Commander with Lister plugins to see what icon size is treated as 'primary' - it depends somehow on the icon editor from which ICO was exported or saved, but logics are not clear to the end.)

P.S. I still use ICO-files (sized from 48 to 16 pix usually) but cannot answer your question about what is their renderer in KM.


Latest Release KM75.1 Latest dev KM76RC ||| Visit The K-Meleon Place and join me there!
Old good stuff: KM-1.6db+NS © dugbugoffice // KM-16-S2014 © Fred // KM-1.6beta2.6 © JamesD // KM Twin+ © rodocop // KM 1.8.24.22 © adodupan

RECOMMENDED! K-Meleon 76 Pro ==» Download portable: 7zip or EXE =//= Discuss on forum
K-Meleon 75.1 Pro: Download =//= Discuss || Portable Flash plugin (x86/x64 DLLs)



Edited 2 time(s). Last edit at 03/14/2017 12:16AM by rodocop.

Options: ReplyQuote
Re: Who renders the icons?
Posted by: rodocop
Date: March 14, 2017 12:18AM

And it would be REALLY GREAT if KM toolbars plugin will get the ability to pick correct sized icon from icon set, according to toolbar size set in KM.


Latest Release KM75.1 Latest dev KM76RC ||| Visit The K-Meleon Place and join me there!
Old good stuff: KM-1.6db+NS © dugbugoffice // KM-16-S2014 © Fred // KM-1.6beta2.6 © JamesD // KM Twin+ © rodocop // KM 1.8.24.22 © adodupan

RECOMMENDED! K-Meleon 76 Pro ==» Download portable: 7zip or EXE =//= Discuss on forum
K-Meleon 75.1 Pro: Download =//= Discuss || Portable Flash plugin (x86/x64 DLLs)

Options: ReplyQuote
Re: Who renders the icons?
Posted by: Yogi
Date: March 14, 2017 01:43AM

Sorry, I'm not a programmer but AFAIK rendering of images is done by browsers.

Edit:
Basically KM/FF can render SVG files.
IMHO it wouldn't be useful at the moment if developers would implement SVG files for skinning. The main disadvantage would be an increased resource wastage.
Rendering of vector graphics is considerable more resource intensive than that of raster graphics.



Edited 2 time(s). Last edit at 03/14/2017 02:16AM by Yogi.

Options: ReplyQuote
Re: Who renders the icons?
Posted by: siria
Date: March 14, 2017 02:20AM

Inside the same toolbar all icons must have the same size.
Have a dim memory from too long back that auto-downscaled icons on Vista looked very fuzzy sad smiley
But not sure if that was the fault of an early KM7x version or still the same for KM76... Also remember struggling mighty with getting the correct icon 'cutout' from a multi-icon picture, had some very weird results...
Sorry probably doesn't help much such fuzzy memory snippets.
But guess we can safely assume that KM itself renders the icons.

Options: ReplyQuote
Re: Who renders the icons?
Posted by: JamesD
Date: March 14, 2017 12:17PM

The icon for basic addblock is 192x32 in png format. I had it done that way in order to support skins with toolbars of 32, 24, 20, and 16 size. I cannot see that much definition is lost when using with a toolbar of size 16. The old system for icons required that I code my macro such that it chose an icon based on there being one of the strings, LG or Large, in the skin name. To say that the old system was a bit hard to use is just being tactful.

I was about to suggest that JohnHell make a resized icon for plugin.state.flash in the 32 size instead of the 16. That is just my idea. I have no skills in making icons so I don't know if 32 is right. I suppose the scaling up works too?

Do icons in the bmp format scale?

Options: ReplyQuote
Re: Who renders the icons?
Posted by: JohnHell
Date: March 14, 2017 05:03PM

Quote
rodocop
And it would be REALLY GREAT if KM toolbars plugin will get the ability to pick correct sized icon from icon set, according to toolbar size set in KM.

Yep, if we use your system of an ICL (icon file with various sizes is actually an ICL file, standing for icon library), that would be great.

Or is not an ICL, whatever, similar. ICO, ICL, the same.

Quote
siria
Inside the same toolbar all icons must have the same size.

That was said by Dorian when he asked for the new skinning system. If it was any problem if he set the new system to have all icons of a said toolbar the same size.

He proposed it here:
http://kmeleonbrowser.org/forum/read.php?2,130547,page=1

And we accepted.

But in the old skinning system, a toolbar can have icons of different sizes. What K-meleon does is get the size told for that icon to crop from the image with that dimensions and adjust then to the toolbar size.

What I don't know is who actually renders it. Might be the OS, but depending of which filter is being used, the difference is dramatic.

http://www.imagemagick.org/Usage/filter/

It would be great to know to decide how to create icons.

Ideally a system like rodocop ICL/ICO, would be great. K-meleon decides based on the toolbar size and voilà, no more problems.


Quote
Yogi
Sorry, I'm not a programmer but AFAIK rendering of images is done by browsers.


But, also for the interface buttons?

That's the doubt.

Sure SVG requires more processing power, but also the files are smaller. Dilemma ;)


Quote
JamesD
Do icons in the bmp format scale?


They do scale, as replied now to siria above, but the upscaling is like hell. It is so blurry. Better effect gives the downscaling.

For my 256x256 try I used a PNG for size purposes, but BMP can be used too.


Quote
JamesD
I was about to suggest that JohnHell make a resized icon for plugin.state.flash in the 32 size instead of the 16. That is just my idea. I have no skills in making icons so I don't know if 32 is right. I suppose the scaling up works too?


I can upload them, yep. I redraw in a vector graphic program, so is not a mistake to make them bigger and bigger.

The problem comes when the output is as tiny as 16x16. Then you have to play with the antialiasing system for the output. Sometimes I end taking the output as base and create the final result in Microsoft Paint. Better "at hand" pixel-art program. Pure art grinning smiley



Edited 2 time(s). Last edit at 03/14/2017 05:07PM by JohnHell.

Options: ReplyQuote
Re: Who renders the icons?
Posted by: Yogi
Date: March 14, 2017 06:46PM

Quote
JohnHell
Sure SVG requires more processing power, but also the files are smaller. Dilemma ;)
Generally speaking that's correct.
But it also depends on the complexity of the drawing and the complexity of the colors/gradients.
Therefore in some cases an SVG can be much bigger in size than a PNG at 16x16, 32x32, 64x64, 128x128 or even 256x256.

Options: ReplyQuote
Re: Who renders the icons?
Posted by: JohnHell
Date: March 14, 2017 07:28PM

Quote
Yogi
Quote
JohnHell
Sure SVG requires more processing power, but also the files are smaller. Dilemma ;)
Generally speaking that's correct.
But it also depends on the complexity of the drawing and the complexity of the colors/gradients.
Therefore in some cases an SVG can be much bigger in size than a PNG at 16x16, 32x32, 64x64, 128x128 or even 256x256.

True, but I was "generally speaking" ;)

We can't give a dissertation about this in this topic smiling smiley

Options: ReplyQuote
Re: Who renders the icons?
Posted by: siria
Date: March 14, 2017 08:58PM

On my Vista big icons looked blurry even DOWNscaled too. But was long ago, could have been one of the old 7X beta versions, no idea if newer KMs are better.

Hm, you sure the old toolbar system can have different button sizes in 1 toolbar??? Not to my knowledge, neither in theory nor reality. Have you tested that?

Options: ReplyQuote
Re: Who renders the icons?
Posted by: rodocop
Date: March 14, 2017 09:21PM

Dorian's question being recalled here was about all TOOLBARS to be equal-sized in skin, not about all buttons in toolbar.

siria,
at least there was a possibility to set size for every single button (when created by macros). But I haven't tested this.


Latest Release KM75.1 Latest dev KM76RC ||| Visit The K-Meleon Place and join me there!
Old good stuff: KM-1.6db+NS © dugbugoffice // KM-16-S2014 © Fred // KM-1.6beta2.6 © JamesD // KM Twin+ © rodocop // KM 1.8.24.22 © adodupan

RECOMMENDED! K-Meleon 76 Pro ==» Download portable: 7zip or EXE =//= Discuss on forum
K-Meleon 75.1 Pro: Download =//= Discuss || Portable Flash plugin (x86/x64 DLLs)

Options: ReplyQuote
Re: Who renders the icons?
Posted by: JohnHell
Date: March 14, 2017 09:37PM

Quote
rodocop
Dorian's question being recalled here was about all TOOLBARS to be equal-sized in skin, not about all buttons in toolbar.

siria,
at least there was a possibility to set size for every single button (when created by macros). But I haven't tested this.

Might be as rodocop is telling here. I might be confused by de (x, y) dimensions to crop from the source image.

I was confused till the end LOL:
http://kmeleonbrowser.org/forum/read.php?2,130547,page=4#msg-131077

Options: ReplyQuote
Re: Who renders the icons?
Posted by: adodupan
Date: March 15, 2017 05:12PM

You can embed image data directly in kmm file using data uri.
Using data uri you can use high quality images and keep good performance.
Here is an example of how to use it:
$OnInit = $OnInit."_psf_;";
$_psf = true;
function psf1($p) {
  if($p == "cold") # it is not used, here is just in case if you want to add other stuff
    return "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAfgSURBVHjaYvz//z/DQAKAAGJiGGAAEEAsMAYjIyMx6lWA2B2IHVkZGLS5GBgEgLoYfzAwfAbiW0DxQ0C8A4gvEjIIFvIAAcQIZ+B3gDkQ5xiwM3h4CDOIWEkxMMhJ8TDwCfCDNDJ8/fyZ4cmzjwynnwJtf8Pw+dh3hoNA9VOAeCchBwAEEJiBJx3wgQyy5mb4u9GA4f/PQo3//7dU/P9/b+f//1/u/P//9w0Qv/3//9v9//8fHfj/f2/L/3+1Jv8PWDD89+VnABm6GohlcTkAhAECCJ8DVNgYGc42yzH8/54i8v//EaDF30/////vwf//v24DLb32///XK0B8Gci++v//z1tQuUv//1/o/P+vWP7/bDWG/4IsDA+BZlnhcgBAAOGKAmUeZoZ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seFhYW4DiG+RoEQPENSu3AuGOQlJREiXtQiQcqeEDZEmQ5rIhFtxyEQYUTKH0AzT8F0w8QQMgF0dbz588D65lv8GADYZBjgBUJg46ODoO6ujo4FcMAKDhfvnwJ9j0suJH1YsNnz54FKd0GMwMggJAdcBnougNXr14FBzXIYpgDQCEByiHIlRDIomfPnjE8fvwYp6UwcVgh9OjRIwagJ0FNt30wcwACiAmtjp6wadMmeGEEMwSUspGbbCBxULxfunQJnNiwBTd6FgQ5ftu2baBQmwg0Ap4IAQIIvTbcDaxc1u/btw/sY5jLQYaAogZU2oHi8MiRIwzAdh/YcpDByAkWHYDMAHkA6HOGAwcOXAAKzUOWBwggbO0BaWB9cKK4uFgGFOcgcVhFg54jkEMFOfHB2LDqGpROuru7v79+/doOKHwGWT1AAOFqFVsCE9v27Oxsfg0NDbADQL4At2AINN9hakAOBYXa06dPGaZOnfoPmFaigNIr0R0MEED4muW23NzcKyIiIqRsbGzAFQyopoRFCUrTGqofFh2gcgCU30HBvmTJkq9An6cAlazA1iwHCCBC/QJlULMcWIV7uLu7g7MiqBQEOgzcDIMVPLCEBvIx0DKGGzduMOzdu5fh8OHDZ4By2UAzTuHqFwAEELEdk0hgnOcB04SFrq4ug4qKCtwhIABrG4AqIlB74Pr169eAqX06UGo2qFbG1zEBCCBiHQDLMaBE5AlUawksFRWBJRsPtB75DiyMHgN9exrI3Q7N59+J6ZoBBBDjQPeOAQJowHvHAAEGABLK880wfQDaAAAAAElFTkSuQmCC";
}
function psf2($p) {
  $locale = _("Plugin State Flash");
  $cmnd = "macros(_psf_)";
  if($p) {
    addtoolbar($locale);
    addbutton($locale, $cmnd, "", $locale);
    $_psf = false;
  } else
    togglepref(INT, "plugin.state.flash", 0, 2);
  checkbutton($locale, $cmnd, getpref(INT, "plugin.state.flash") == 0 ? true : false);
  setcmdicon($cmnd, getpref(INT, "plugin.state.flash") == 0 ? psf1("dead") : psf1("hot"));
}
# functions can not be used as commands
_psf_ {
  psf2($_psf);
}
Code above requires km 75.1

Code below requires km 75.0
$OnInit = $OnInit."_psf_01;";
$_psf_locale = _("Plugin State Flash");
$_psf_cold = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAfgSURBVHjaYvz//z/DQAKAAGJiGGAAEEAsMAYjIyMx6lWA2B2IHVkZGLS5GBgEgLoYfzAwfAbiW0DxQ0C8A4gvEjIIFvIAAcQIZ+B3gDkQ5xiwM3h4CDOIWEkxMMhJ8TDwCfCDNDJ8/fyZ4cmzjwynnwJtf8Pw+dh3hoNA9VOAeCchBwAEEJiBJx3wgQyy5mb4u9GA4f/PQo3//7dU/P9/b+f//1/u/P//9w0Qv/3//9v9//8fHfj/f2/L/3+1Jv8PWDD89+VnABm6GohlcTkAhAECCJ8DVNgYGc42yzH8/54i8v//EaDF30/////vwf//v24DLb32///XK0B8Gci++v//z1tQuUv//1/o/P+vWP7/bDWG/4IsDA+BZlnhcgBAAOGKAmUeZoZdc9QZlMLDZBgYYqIZGAQ1GRi+f2Ng+PcXf+QyAtM1JzB1/ADGx9olDAcX32CIuczw8clPBh+g7BH0KAAIIGwO4GVjYji0QIPBINJfiIEhzIyBgRVI//6N32JmoH4WIP77j4HhDxCzcgAFPzMwbDvNcHDFc4aQywwv3vxmsAQKPkB2AEAAsWAxqqNMjsEgxBiYzm2BFr9/BlT9HKQD5EyY+xFsEAWMq+/PPzO8uviS4dvb/ww/PrMzcIszM6j5AVOrET+DzcMPDB3fvkuk3mCY9R+Si+BxDhBA6A4wMeVnyMhUAKrQ4wQGOdAHn7+AUzpaDEJsBgkz/2d4cvQ1w7s3MgyCLsUMMsbODH/ev2V4PCGEgeENpJj5p8vBEHT3O8P29wyua18yhAKFVsFMAgggdAcU5sgyMHGJMDL85/3L8PvNF6AdjGD7GZH8D/M4A8t/hoeHvjL8lPFl0J4yh4GZRwws9/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EED4muW23NzcKyIiIqRsbGzAFQyopoRFCUrTGqofFh2gcgCU30HBvmTJkq9An6cAlazA1iwHCCBC/QJlULMcWIV7uLu7g7MiqBQEOgzcDIMVPLCEBvIx0DKGGzduMOzdu5fh8OHDZ4By2UAzTuHqFwAEELEdk0hgnOcB04SFrq4ug4qKCtwhIABrG4AqIlB74Pr169eAqX06UGo2qFbG1zEBCCBiHQDLMaBE5AlUawksFRWBJRsPtB75DiyMHgN9exrI3Q7N59+J6ZoBBBDjQPeOAQJowHvHAAEGABLK880wfQDaAAAAAElFTkSuQmCC";
_psf_01 {
  addtoolbar($_psf_locale);
  addbutton($_psf_locale, "macros(_psf_02)", "", $_psf_locale);
  &_psf_03;
}
_psf_02 {
  togglepref(INT, "plugin.state.flash", 0, 2);
  &_psf_03;
}
_psf_03 {
  checkbutton($_psf_locale, "macros(_psf_02)", getpref(INT, "plugin.state.flash") == 0 ? true : false);
  setcmdicon("macros(_psf_02)", getpref(INT, "plugin.state.flash") == 0 ? $_psf_dead : $_psf_hot);
}



Edited 3 time(s). Last edit at 03/15/2017 07:50PM by adodupan.

Options: ReplyQuote
Re: Who renders the icons?
Posted by: JohnHell
Date: March 15, 2017 06:35PM

Nice one adodupan. I'll try later this feature.



BTW, the question of this thread might be answered here, even though this is for favicons:

http://kmeleonbrowser.org/forum/read.php?1,126717#msg-128662


Maybe Dorian uses Gecko as well to render the toolbar icons. And can be possible looking at the way adodupan loads image by data images.

K-meleon shell only resizes it.



Edited 1 time(s). Last edit at 03/15/2017 06:35PM by JohnHell.

Options: ReplyQuote
Re: Who renders the icons?
Posted by: rodocop
Date: March 15, 2017 06:45PM

And how to create this data:uri from the real image?

Well I know about PHF converters but how can I do it with single image not on html-page?


Latest Release KM75.1 Latest dev KM76RC ||| Visit The K-Meleon Place and join me there!
Old good stuff: KM-1.6db+NS © dugbugoffice // KM-16-S2014 © Fred // KM-1.6beta2.6 © JamesD // KM Twin+ © rodocop // KM 1.8.24.22 © adodupan

RECOMMENDED! K-Meleon 76 Pro ==» Download portable: 7zip or EXE =//= Discuss on forum
K-Meleon 75.1 Pro: Download =//= Discuss || Portable Flash plugin (x86/x64 DLLs)

Options: ReplyQuote
Re: Who renders the icons?
Posted by: JohnHell
Date: March 15, 2017 06:52PM

Quote
rodocop
And how to create this data:uri from the real image?

Well I know about PHF converters but how can I do it with single image not on html-page?

With a base64 encoder.

http://www.fourmilab.ch/ (under Windows utilities section)

The command will be base64 image.extension output.txt.

Open output.txt and there it is the image encoded. Note that the base64 encoded images will be quite larger than original.

Options: ReplyQuote
Re: Who renders the icons?
Posted by: JohnHell
Date: March 15, 2017 07:29PM

I forgot I can't test adodupan code.

Functions weren't available in 75.0.

Options: ReplyQuote
Re: Who renders the icons?
Posted by: JamesD
Date: March 15, 2017 08:02PM

If we macro writers could define the image in the way adodupan does with data uri, it would mean the kmm file could contain everything. There would not be a need to create a 7z with folders skins and shared.

It would be interesting to know about space requirements. Kmm files are plain text. Also could the kmm file work like an omni and be zipped with some compression?

Options: ReplyQuote
Re: Who renders the icons?
Posted by: rodocop
Date: March 15, 2017 08:11PM

Well, my lovely Total Commander can encode this, I found!

Have tested:
1) BMP image 1590b in size was converted into 2174b data code;
2) PNG image 5681b in size was converted into 7774b data code.

Code size is almost 137% of image size in general.


Latest Release KM75.1 Latest dev KM76RC ||| Visit The K-Meleon Place and join me there!
Old good stuff: KM-1.6db+NS © dugbugoffice // KM-16-S2014 © Fred // KM-1.6beta2.6 © JamesD // KM Twin+ © rodocop // KM 1.8.24.22 © adodupan

RECOMMENDED! K-Meleon 76 Pro ==» Download portable: 7zip or EXE =//= Discuss on forum
K-Meleon 75.1 Pro: Download =//= Discuss || Portable Flash plugin (x86/x64 DLLs)



Edited 1 time(s). Last edit at 03/15/2017 08:20PM by rodocop.

Options: ReplyQuote
Re: Who renders the icons?
Posted by: JamesD
Date: March 15, 2017 08:11PM

Quote
JohnHell
I forgot I can't test adodupan code.

Functions weren't available in 75.0.

Try this::

Quote
adodupan
Code below requires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IqRsbGzAFQyopoRFCUrTGqofFh2gcgCU30HBvmTJkq9An6cAlazA1iwHCCBC/QJlULMcWIV7uLu7g7MiqBQEOgzcDIMVPLCEBvIx0DKGGzduMOzdu5fh8OHDZ4By2UAzTuHqFwAEELEdk0hgnOcB04SFrq4ug4qKCtwhIABrG4AqIlB74Pr169eAqX06UGo2qFbG1zEBCCBiHQDLMaBE5AlUawksFRWBJRsPtB75DiyMHgN9exrI3Q7N59+J6ZoBBBDjQPeOAQJowHvHAAEGABLK880wfQDaAAAAAElFTkSuQmCC";
_psf_01 {
  addtoolbar($_psf_locale);
  addbutton($_psf_locale, "macros(_psf_02)", "", $_psf_locale);
  &_psf_03;
}
_psf_02 {
  togglepref(INT, "plugin.state.flash", 0, 2);
  &_psf_03;
}
_psf_03 {
  checkbutton($_psf_locale, "macros(_psf_02)", getpref(INT, "plugin.state.flash") == 0 ? true : false);
  setcmdicon("macros(_psf_02)", getpref(INT, "plugin.state.flash") == 0 ? $_psf_dead : $_psf_hot);
}




Options: ReplyQuote
Re: Who renders the icons?
Posted by: JohnHell
Date: March 15, 2017 09:36PM

Ok, that worked.

So,looks like Gecko might be used to read images for interface as well.

Nice discovery, really.

I had the feeling of the connection between JS and macro language, but not at this level.

Options: ReplyQuote
Re: Who renders the icons?
Posted by: rodocop
Date: March 17, 2017 08:02PM

Quote
JohnHell
Yep, if we use your system of an ICL (icon file with various sizes is actually an ICL file, standing for icon library), that would be great.

Just to be precise: ICL-file contains multiple icons in multiple (optionally) sizes; ICO-file contains single icon but also can store multiple sizes of it. This doesn't make it ICL.


Latest Release KM75.1 Latest dev KM76RC ||| Visit The K-Meleon Place and join me there!
Old good stuff: KM-1.6db+NS © dugbugoffice // KM-16-S2014 © Fred // KM-1.6beta2.6 © JamesD // KM Twin+ © rodocop // KM 1.8.24.22 © adodupan

RECOMMENDED! K-Meleon 76 Pro ==» Download portable: 7zip or EXE =//= Discuss on forum
K-Meleon 75.1 Pro: Download =//= Discuss || Portable Flash plugin (x86/x64 DLLs)

Options: ReplyQuote


K-Meleon forum is powered by Phorum.