Extensions :  K-Meleon Web Browser Forum
All about K-Meleon extensions. 
Dark Mode?!
Posted by: Old Faithful
Date: December 27, 2019 03:46AM

Hello, Greetings.

New user here, trying to get a browser that doesn't constantly crash like Firefox and read a lot of good about K-Meleon.

So I managed to copy my Firefox XPIs and get some of them installed, but can't seem to find a way to get them to work (no buttons or menu - can't find a way to activate a menu neither, it seems permanently hidden behind the gear button - but I digress)

The problem I am having is that I can't seem to find ANYTHING about a Dark Mode and without a Dark Mode, I simply cannot use this browser, it hurts my eyesight too much.

A search on DuckDuckGo and on Google turned up NO RESULTS for "K-Meleon" "Dark Mode"!!!

What am I missing?

Options: ReplyQuote
Re: Dark Mode?!
Posted by: JohnHell
Date: December 27, 2019 05:48PM

Quote
Old Faithful
So I managed to copy my Firefox XPIs and get some of them installed, but can't seem to find a way to get them to work

K-meleon is not a Firefox clon. Their shell, their interface, differ and so the XPI add-ons can't create/interact with the K-meleon interface. The K-meleon interface is a native Windows interface. Firefox interface is built upon XUL.

To mimic buttons and menus from those add-ons, they must be created through macro language (http://kmeleonbrowser.org/docs.php).


They only share the engine (if you are using the official based on Gecko, instead the Goanna fork, which uses Palemoon engine, that is a fork of Gecko engine), that, after all, is made by Mozilla.

You are not telling what version are you using, and so would differ the engine version as well, so the above is informative.

Quote
Old Faithful
(no buttons or menu - can't find a way to activate a menu neither, it seems permanently hidden behind the gear button - but I digress)

From that gear, > view > toolbars > menu (or any other toolbars)

Quote
Old Faithful
The problem I am having is that I can't seem to find ANYTHING about a Dark Mode and without a Dark Mode, I simply cannot use this browser, it hurts my eyesight too much.

A search on DuckDuckGo and on Google turned up NO RESULTS for "K-Meleon" "Dark Mode"!!!

What am I missing?

It doesn't come with a Dark Mode/high contrast mode.

Unless you know of an XPI extension that does that, you'll have to use a JavaScript script (from sources like Greasemonkey) and inject it to achieve it or use the greasemonkey adapted add-on on these forum pages. But have to say that from my own tests that can be high CPU hungry process and won't work always as expected. Not a fault of K-meleon or scripts, but how pages are created.

Options: ReplyQuote
Re: Dark Mode?!
Posted by: Anonym
Date: December 27, 2019 07:25PM

@Old Faithful
1.replace the file:"KM76.2-Goanna-20191214\Profiles\xxxxxxxx.default\chrome[b]adblock.css[/b]"
https://www.upload.ee/files/10898268/adblock.css.html
2.switch style:

Options: ReplyQuote
Re: Dark Mode?!
Posted by: JohnHell
Date: December 27, 2019 10:05PM

You forgot to tell that colors should be blocked too, as you have it checked too.

Otherwise, won't fully work. Am I wrong?

It not bad method, anyway.


You should have cleaned up that file and post only the modifications for that kind of dark mode winking smiley I think.

Options: ReplyQuote
XPI add-ons and K-meleon interface
Posted by: adodupan
Date: December 28, 2019 04:04AM

Quote
JohnHell
so the XPI add-ons can't create/interact with the K-meleon interface.
To mimic buttons and menus from those add-ons, they must be created through macro language (http://kmeleonbrowser.org/docs.php).

It is unexpected to read this from you.

I have km, all the user interface is written in javascript, or to be clear, all menu items and toolbar buttons are written in javascript. It does not need the macros.dll file, it is all possible using jsbridge functions.
It was all written 4-5 years ago and it works better than official km.
Some things are missing, it's not possible to write code for a button with an icon and text inside, also menu items need to be commands to display icons in menus, which stopped me in the past to write code for bookmarks.
Also there are missing some things, which is why i couldn't write code for sessions, but it's generally not a problem for addons.

Now that you know it's possible to write code for buttons and menu items, you need to write exactly where you need a button and menu item and i'll show you an example.

Regards

Options: ReplyQuote
Re: Dark Mode?!
Posted by: Anonym
Date: December 28, 2019 08:02AM

classic theme - example
toolbar button https://www.upload.ee/files/10900009/K-M_Dark_Mode.zip.html
button

Options: ReplyQuote
Re: XPI add-ons and K-meleon interface
Posted by: JohnHell
Date: December 28, 2019 06:49PM

Quote
adodupan
I have km, all the user interface is written in javascript, or to be clear, all menu items and toolbar buttons are written in javascript. It does not need the macros.dll file, it is all possible using jsbridge functions.
It was all written 4-5 years ago and it works better than official km.
Some things are missing, it's not possible to write code for a button with an icon and text inside, also menu items need to be commands to display icons in menus, which stopped me in the past to write code for bookmarks.
Also there are missing some things, which is why i couldn't write code for sessions, but it's generally not a problem for addons.


The problem, adodupan, is that the few times I have read about JSBridge in the latest years were probably coming from you (mostly; almost sure all times) and, to be fair, even the regulars users around here (few now), there must be you, and... maybe Dorian? who only know how it works.

The documentation, or the wiki, doesn't help either JsbridgePlugin. Lack of examples, lack of knowledge. Starting from the obvious (or what I understood, better said), the editing of extensions to append pieces of code to interact with K-meleon. And all joint, lack of interest.

If you request me to put them on a balance... ehmmmm..., yeah, macro language, by independence (avoiding editing extensions, as how I understood), or well established roots (20 years of macro language) against lack of knowledge of JSBridge.... mmmm yeah, macro language is, by far, simplest and quicker. What would I recommend...? mmmmhhh, let me think..., oh, yeah, macro language. Being true or not, it is my perception and so what I recommend.

JSBridge is the last thing in my mind, not even because I relegated..., no, it is because it hasn't even a place on it. Until someone mentions it here in the forum. Mostly you, if not only you.


Quote
adodupan
Now that you know it's possible to write code for buttons and menu items, you need to write exactly where you need a button and menu item and i'll show you an example.

Regards

The problem is I (most of us) don't know how to and where to, so if you want to give knowledge to all of us, please, go to that wiki article, edit it with all the information needed and open our eyes, starting (as I'm in this thread) by me. But I had to admit I don't have much interest, starting from that I don't use XPI extensions, only a couple, and not regularly, with the exception of microRSS ultra modded by me (and the building script, javascript, I mean, not the XUL part).

If JSBridge would open XPI extensions world to K-meleon, please, do it and give us knowledge.

http://kmeleonbrowser.org/wiki/JsbridgePlugin

*****///*****////*******/////

Sorry for the following off-topic. All of the above has been, after all.

Quote
adodupan
Quote
JohnHell
so the XPI add-ons can't create/interact with the K-meleon interface.
To mimic buttons and menus from those add-ons, they must be created through macro language (http://kmeleonbrowser.org/docs.php).

It is unexpected to read this from you.



Two in a row in a few days (not only you).

Really, I can't understand what image I cast over people around here because I haven't given any clue of any special ability, skills or knowledge (or whatever you would like to call it), but doesn't stop to amaze me the attribution of virtuosities I don't have. Is unexpected from me, really? Please, tell me why, because I don't know why.

Let me laugh so loud with pure embarrassment


So, said all the above..., unexpected... ammmm..., no.



Edited 1 time(s). Last edit at 12/28/2019 06:56PM by JohnHell.

Options: ReplyQuote
Re: XPI add-ons and K-meleon interface
Posted by: adodupan 
Date: December 29, 2019 07:32AM

Well virtuoso, i had in mind your presence here, that's why it was unexpected : )
It does not matter, your message is clear, you're not interested. I'm sorry if i possibly made you uncomfortable, that wasn't my intention.

Good luck and best regards

Options: ReplyQuote
Re: XPI add-ons and K-meleon interface
Posted by: JohnHell
Date: December 29, 2019 07:41PM

But others might be interested and what I was trying to say is that there isn't even a deep tutorial with examples that people can take and start using it.

It offends me because it was as it is my duty to have knowledge about it (by being here?). If you understand it and have knowledge about it and you think it is better, go and teach us, and a good starting point is the wiki article I pointed.

The fact, from my point of view, is that JSBridge is absolutely unknown to most of us, so don't expect, at least from me.

Maybe if we had knowledge we could have interest. Personally, at this point, I don't have. I can't see the advantages confused smiley If they are, I can't see them. I don't use XPIs add-ons, anyway.

Most I see is: "look, take this and make reverse engineering to understand it".



Anyway, let me modulate this and tell that I'm sorry, too, if I sounded rough.



Edited 3 time(s). Last edit at 12/29/2019 07:53PM by JohnHell.

Options: ReplyQuote
Re: Dark Mode?!
Posted by: Old Faithful
Date: December 31, 2019 05:39AM

WOW!!!! Anonymous, This Worked !!!

I'm amazed how many reposnses my post got since my last visit, thank you so much for coming to my rescue! I guess I have to find a way to get the forum to notify me of new answers to post I participate in ;-)

After the Holliday Rush I should be able find a bit more time to explore. I'm looking forward to it!!!

Salutations from the Great White North :-)

Options: ReplyQuote
Re: Dark Mode?!
Posted by: Anonym
Date: December 31, 2019 06:13AM

@Old Faithful
Ok*)

Options: ReplyQuote
Re: Dark Mode?!
Posted by: JohnHell
Date: December 31, 2019 03:33PM

Quote
Old Faithful
I guess I have to find a way to get the forum to notify me of new answers to post I participate in ;-)


Don't bother.

SourceForge disabled the mail server for all projects and the forum can't notify you when there are new messages. Just come back when you can/remember.

Options: ReplyQuote
Re: Dark Mode?!
Posted by: Old Faithful
Date: January 01, 2020 06:51AM

Thanks for the clarification!

So far I LOVE everything I see with k-Meleon. It's been working great on the sites I visit most often and that, to me, is an immense relief.

Coming from Firefox, it's a steep learning curve to get stuff work the way I want, especially how customizations work in k-meleon (I miss the add-on functionality I'm used to, especially how uBlock Origine allows you to remove garbage) but after the great responses I got here have good hope I'll be able to get things to work the way I want :-)

Happy New year, Looking Forward to 2020!

Options: ReplyQuote
Re: Dark Mode?! (userstyle workaround adblock import)
Posted by: siria
Date: July 12, 2020 07:19PM

from http://kmeleonbrowser.org/forum/read.php?19,148500,152741#msg-152741
Quote

@private
1. replace the file: KM-Goanna\Profiles\xxxxxxxx.default\chrome\ > adblock.css
https://www.upload.ee/files/10898268/adblock.css.html
2. switch style:

Yes this works, somehow, but I keep thinking there must be easier ways....

At least a LITTLE better, new trick:
Add something like this at the BEGIN of ..profile../chrome/adblock.css or userContent.css:
@import url(import_darkmode.css);

In my little testfile this only worked with "!important" rules:
@-moz-document domain(kmeleonbrowser.org) {
	body {background-color: yellow !important;}
}

And of course, put the new stylesheet into the same folder.
Or test if your KM-version allows other paths?
@import url(file:///D:/K-Meleon_STYLES/import_darkmode.css);
@import url(../../STYLES/import_darkmode.css);

Firefox has probably a native css stylesheet for darkmode which could be used in KM too, probably hidden somewhere in one of the 2 omni.ja's (can be unzipped)

Actually that's an extremely old trick, just learned it far too late, as usual. Why no one ever tells us here such easy stuff?! And no clue if it still works in KG76, have only tested in KM1.6

CATCH:
- To disable or to update file changes, userContent.css needs a browser restart (at least in old KM-versions, no idea about newer ones?)
- From adblock.css, it's possible to toggle it On/Off and update file changes, BUT whole adblock.css must be enabled/disabled TOO). Yet another prob, toggling adblock repaints ALL open tabs, and even reloads all the adblocked stuff in them, which is extremely SLOOOW on my old computer. Even when setting it offline first, to prevent loading the adblocked stuff from web.

HowTo toggle adblock.css:
menu Tools > Privacy > BlockAdvertisement,
or right-click on a toolbar button which has this Privacy menu on right-click (..macro...|&Privacy)
or with a keyboard shortcut (in accel.cfg) with command "macros(KM_ToggleAdblock)",
or the same command in a do-it-yourself button in toolbars.cfg:
macros(KM_ToggleAdblock)|&Privacy

But am sure there MUST be easier ways to handle userstyles!
Faster, more flexible, and for easily handle many different css files.

Probably with the popular "Stylish" addon, or something similar? Have read Stylish has been sold to an ad/tracking/data-collector company awhile back, but the older versions are clean and still exist too in archives. And KM usually likes older addon versions better anyway.
Perhaps there's even a special adjusted version for old KM1.x on kmext.sf.net, and/or in the forum here somewhere? Or perhaps a younger, pure xpi-addon now runs natively in KG76 too, or probably an addon for PaleMoon26, but am too busy with other stuff to investigate this myself.



Edited 2 time(s). Last edit at 07/12/2020 07:59PM by siria.

Options: ReplyQuote
Re: Dark Mode?! (userstyle workaround adblock import)
Posted by: siria
Date: July 14, 2020 05:59AM

An interesting overview about Firefox methods for changing styles:
http://kb.mozillazine.org/Use_my_colors

Options: ReplyQuote


K-Meleon forum is powered by Phorum.