General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
userContent.css ON/OFF: how to?
Posted by: cpm1a_new
Date: August 10, 2019 01:47PM

i badly miss the Author/User mode of good old Opera 12. can anyone help with adding this ability to KM 76.2 GoAnna? i mean toggling the CSS on/off without restart. maybe Stylish could help, but i need a step-by-step procedure to put it in, coz i tried and didn't make it

or maybe something else could do the trick?
any help/ideas appreciated, thanx in advance

Options: ReplyQuote
Re: userContent.css ON/OFF: how to?
Posted by: JohnHell
Date: August 10, 2019 03:17PM

Quote
cpm1a_new
i badly miss the Author/User mode of good old Opera 12. can anyone help with adding this ability to KM 76.2 GoAnna? i mean toggling the CSS on/off without restart. maybe Stylish could help, but i need a step-by-step procedure to put it in, coz i tried and didn't make it

or maybe something else could do the trick?
any help/ideas appreciated, thanx in advance

Use your "profilefolder\chrome\adblock.css" instead.

To toggle, use the tools menu, privacy, block advertisement or add the macro KM_ToggleAdblock to your "profilefolder\accel.cfg" to some key combo.




Off-topic: if you have troubles with your old account, I can set and send you a new password.



Edited 1 time(s). Last edit at 08/10/2019 03:20PM by JohnHell.

Options: ReplyQuote
Re: userContent.css ON/OFF: how to?
Posted by: siria
Date: August 10, 2019 04:25PM

For quick brutal toggles of all stylesheets OFF I'm using StyleKiller:
http://kmeleonbrowser.org/forum/read.php?9,146712
Along with a bunch of other selfwritten macros.

And yes, like JohnHell am using adblock.css as switchable userContent.css replacement.
Of course, with heavily changed content, self-written tweaks. The original content is a small, 10 years old adblock list, and it contains far too many false positives! So had to throw out a couple rules and added countless little page tweaks myself. Not for adblocking (without javascript there are hardly any ads anyway) but for getting the normal page content readable. Without JS and despite my ancient KM-version.

adblock-toggle would be nice, but the prob is, it has a bad bug, at least in my old KM-version (not sure if still in current KM? Am afraid yes...)
It toggles not only the current page, but immediately starts refreshing ALL tabs in the window, or perhaps even session! sad smiley
So I can toggle adblock only occasionally for checking how a page looks without my many css-tweaks, if it's my styles which are messing it or not.

My improvement wishes since years:
  • userContent.css please toggable during session
  • adblock.css shall toggle the pref but refresh ONLY the current page, as it did in ancient KM-versions
  • And permissions.sqlite would be great to have toggable too


Options: ReplyQuote
Re: userContent.css ON/OFF: how to?
Posted by: cpm1a_new
Date: August 10, 2019 05:38PM

1) i should append my userContent.css code to the end of the adblock.css code and delete my userContent.css in the same directory, right? no effect at all so far... either it doesn't work for KM 76.2 GoAnna or I do something wrong.

>So had to throw out a couple rules and added countless little page tweaks myself. Not for adblocking (without javascript there are hardly any ads anyway) but for getting the normal page content readable. Without JS and despite my ancient KM-version.
2) it's very, very interesting... did you share this?

3) can Stylish toggle userContent.css?
----------
i keep forgetting to apolozize for my Russian English)))



Edited 1 time(s). Last edit at 08/10/2019 06:03PM by cpm1a_new.

Options: ReplyQuote
Re: userContent.css ON/OFF: how to?
Posted by: siria
Date: August 10, 2019 06:16PM

Quote
cpm1a_new
1) i should append my userContent.css code to the end of the adblock.css code and delete my userContent.css in the same directory, right? no effect at all so far... either it doesn't work for KM 76.2 GoAnna or I do something wrong.

You probably just forgot to switch it on? Either in Tools>Privacy menu or in F2 > Page Display > Content Filters

You can just rename your files. The original adblock has lots of false positives, it would delete too much stuff.

KM Pro has some addons embedded, am not familiar what those are doing exactly (except the quirky useragent addon)

Your english is fine, and this is an international forum, most of us are not native english :-)

Options: ReplyQuote
Re: userContent.css ON/OFF: how to?
Posted by: cpm1a_new
Date: August 10, 2019 06:40PM

>You probably just forgot to switch it on?
yes. i DID... now it works, thank you. IIRC you rote about this "method" back in 2014, right?



Edited 2 time(s). Last edit at 08/10/2019 06:57PM by cpm1a_new.

Options: ReplyQuote
Re: userContent.css ON/OFF: how to?
Posted by: cpm1a_new
Date: August 10, 2019 07:07PM

Quote
JohnHell
Use your "profilefolder\chrome\adblock.css" instead
thanks a lot!

Options: ReplyQuote
Re: userContent.css ON/OFF: how to?
Posted by: cpm1a_new
Date: August 10, 2019 07:09PM

1) to make me yet more happy i need a macros ToggleImages+Reload. can anyone help?

2) last but not least (just not to start a separate topic): in Opera 12 i use SHIFT to choose current or next tab to open a bookmark in. FF has a context menu for this. KM seems to have nothing and it's very inconvenient IMHO. has anyone tried to fix this?

thanks



Edited 6 time(s). Last edit at 08/10/2019 07:43PM by cpm1a_new.

Options: ReplyQuote
Re: userContent.css ON/OFF: how to?
Posted by: siria
Date: August 10, 2019 09:22PM

Quote
cpm1a
1) to make me yet more happy i need a macros ToggleImages+Reload. can anyone help?

Yeah don't worry, if you just mean the normal reload command that's rather easy, you'll get it. What just bothers me is the unnecessary reloading part from the web, if the only purpose is to toggle images on and off. Tried to find a way to do that offline, but running against a wall of bugs again, as usual sad smiley (in KM1.6) But probably sufficient anyway to just toggle the images on/off by changing the src tag, just waiting a bit for ano to give us more hints which already existing macros he meant :cool: And am also not quite sure if changing the src is reliable enough or if the page scripts may interfer, then the engine's image toggle would perhaps be better again. No clue...

Quote
cpm1a
2) last but not least (just not to start a separate topic): in Opera 12 i use SHIFT to choose current or next tab to open a bookmark in. FF has a context menu for this. KM seems to have nothing and it's very inconvenient IMHO. has anyone tried to fix this?

Sigh... Yes that's actually a native function and in 'theory' no prob. When you open the Bookmark Options you can choose how the left/middle/right mouse buttons shall open the selected bookmark, in same or new tab etc. The little catch is, it only works if you're opening the Bookmarks menu in the menu bar, not the one on the button!
But the current fashion is to keep the menu bar hidden, so have now done some extensive button testing in KG76.2 (another computer, not online) and it looks like that's going to be slightly more complicated than first thought... Tried all sorts of command variations, and discovered a funny thing: when using "rebarmenu(&Bookmarks)" as command on the button, it opens the link in the method that is set for "Typed URLs"! In F2 > Open / Typed URLs. So if (??) you want to open typed URLs in new tabs anyway, a workaround could be to copy the existing button (in toolbars.cfg) and give the copy this new command, and have 2 buttons: 1 for opening in same tab, and 2 for opening in new tab... or similar. Oh almost forgot: and the 2nd button has no icon yet. Must be defined in skins.cfg

Another workaround: Use the Edit view directly on that button (command "bookmarks(Edit)". That view has a context menu on the bookmarks. Just looks stupid to open a window when only wanting a menu.

Anyway, while dealing with bookmarks, a little tip, not sure if already known: Find the bookmark for google, edit it, and in the "Nick" field below it, input g. Then you can type "g whatever" in the urlbar and the browser will search for "whatever" using google. The bookmark contains "%1", that will be replaced with the word(s) in the urlbar when clicking it. All bookmarks and all folders can get such a nickname, free choice.



Edited 1 time(s). Last edit at 08/10/2019 09:25PM by siria.

Options: ReplyQuote
Re: userContent.css ON/OFF: how to?
Posted by: cpm1a_new
Date: August 11, 2019 07:05AM

1) thanks for your effort. i open bookmarks thru the menu in the menu bar only. surprisingly, if you hover the cursor on an item and right-click -- the bookmark will open in a new window! i discovered this just an hour ago ))) . even quicker than pressing SHIT in Opera 12
2) i do use the "Nick" trick
3) macros ToggleImages+Reload: yeah, waiting for ano... src-tag or normal reload -- its up to you to decide

Options: ReplyQuote
Re: userContent.css... / Howto Bookmarks in new tab
Posted by: siria
Date: August 11, 2019 07:40AM

Quote
cpm1a_new
i open bookmarks thru the menu in the menu bar only. surprisingly, if you hover the cursor on an item and right-click -- the bookmark will open in a new window! i discovered this just an hour ago )))

Yes, you can freely choose how the left / middle / right mouse buttons open bookmarks smiling smiley



The catch is just that the middle+right buttons only work on this text menu, not when hiding it and opening the menu with the button.

( _HowTo_ bookmarks options right-click middle-click mouse button newtab)



Edited 3 time(s). Last edit at 08/11/2019 07:49AM by siria.

Attachments: bookmarks__HOWTO_open__MouseButtons.png (23.5 KB)  
Options: ReplyQuote
Re: userContent.css... / Howto Bookmarks in new tab
Posted by: cpm1a_new
Date: August 11, 2019 08:21AM

>The catch is just that the middle+right buttons only work on this text menu
thats all i need...

Options: ReplyQuote
Re: userContent.css... / Tiny macro (TogImgReloadWEcool smiley
Posted by: siria
Date: August 11, 2019 10:24AM

Quote
cpm1a_new
1) to make me yet more happy i need a macros ToggleImages+Reload. can anyone help?

Sorry for taking so long, but have started making an image-toggle macro without needing reload, then running into other probs. That version will be finished too, just need a bit longer to finish. But I suppose you probably don't need it anyway if you have a fast connection.

What you really requested is just an ultrasimple 2-line macro!
toggle images + reload page
Finally, here is exactly what you wanted smiling smiley
Just download the attached kmm-file into a macros folder and restart.
You can edit the content as you wish (menu text etc)

macro TogImgReloadWeb
PS: This macro can also serve as a little example macro, to simply combine 2 commands, and create a menu line and a keyboard shortcut.



Edited 1 time(s). Last edit at 08/11/2019 10:29AM by siria.

Attachments: TogImgReloadWeb.kmm (644 bytes)  
Options: ReplyQuote
Re: userContent.css... / Tiny macro (TogImgReloadWEcool smiley
Posted by: cpm1a_new
Date: August 11, 2019 01:42PM

i am completely happy, thanks so much! works just as i expected. but i would like to try the other version too some time in the future (if you won't give up on it)

>This macro can also serve as a little example macro
again, this is just what i want: i will try writing stuff by myself

Options: ReplyQuote
Re: userContent.css... / Tiny macro (TogImgReloadWEcool smiley
Posted by: cpm1a_new
Date: August 11, 2019 03:50PM

off-topic, just not to start a new one. i would like to get your expert opinion/treatment

i have absolutely no knoledge of CSS, so i just changed colors, not touching anything else. works imho pretty decent, as it doesn't hide too many images on web pages. any improvements are welcome

it doesn't change the colors of KM's chrome://history/content/history.xul. not a big prob really, i can live with this. but still, can it be fixed?

https://drive.google.com/file/d/1kgNhPR9vwotVZFtPIn2Elime8tCGZauV/view?usp=sharing



Edited 5 time(s). Last edit at 08/12/2019 08:08AM by cpm1a_new.

Options: ReplyQuote
Re: userContent.css... / style browser XUL pages
Posted by: siria
Date: August 14, 2019 08:00AM

Quote
cpm1a_new
off-topic, just not to start a new one. i would like to get your expert opinion/treatment

Oops... if you don't write a new post, and there are no other new posting either yet, no one will notice that you edited your last one! :O
And would be great if I were an expert, and strongly wish at least there were others around I could ask myself for tips, but no luck. So am just struggling along like you too, trying to self-help, just collecting a bit spotty knowledge here and there. Just perhaps since a longer time already ;-) (regarding all those years, I should actually be long since an expert, the prob is just that stuff is so complicated and especially JS so alien to my natural logical thinking, that I keep forgetting it again after a few days ;-)

Quote
cpm1a_new
i have absolutely no knoledge of CSS, so i just changed colors, not touching anything else. works imho pretty decent, as it doesn't hide too many images on web pages. any improvements are welcome

If you want to style all pages completely yourself, that's a very complicated project, and often makes things worse instead of better. There are already several projects of that sort around, FF addons like readability and lots of userstyles for FF, which probably can be used in userContent.css too. I've tried those a bit in the past, but found just too many probs. Since then am just taking the easy road out: keeping the original styles, to not miss anything if possible. If that's causing any probs, usually due to my very old KM-version, am just toggling all original stylesheets off, which on most pages works wonders (not always prettier, but readable and working) If there are still layout probs, and if it's an important site to me, will poke around in the source code and try to find little rules just for that site, to add in adblock.css, example:

/* --------- PM forum  ---------
linked images are hidden behind a "Show" button, which needs JS 
https://forum.palemoon.org/viewtopic.php?t=17764
*/
@-moz-document domain(forum.palemoon.org) {
div.alt2 > div {display: inline !important; padding: 0px !important; } 
}

(That's a very short one, have also highly complicated ones, but with your newer engine you won't need those)
Did you know you can define styles only for certain domains? Or similar, for all urls starting with "url-prefix... " etc.? Took me years to discover myself. So much stuff that works but just no clue it exists sad smiley
If still too many probs on a site, may even fiddle to create little userscripts for that site - which is yet more complicated as CSS, requiring some JS experience (or in my case: lots of previously collected js-snippets as example, or finding new ones around the web, or, sigh, struggle endlessly to find a solution myself) But one of those JS-snippets (created earlier) now just allowed me to get your file downloaded from googledrives, without JS, after seeing only a blank page first - yay! smiling smiley
But that's of course just my personally preferred method, and of course requires too an awful lot of learning.

Quote
cpm1a_new
it doesn't change the colors of KM's chrome://history/content/history.xul. not a big prob really, i can live with this. but still, can it be fixed?

Not sure about KM7x, but try this:
create a file "userChrome.css" in the same folder as adblock, make its format UFT-8, and restart.
That file is a native Firefox function too, search the web for examples. Just keep in mind that in KM it's not possible to style buttons and toolbars with it, which are NOT xul but native window style. But for opening xul-files it should work. Have once tried this in KM1.6 and worked to style all my F2 sheets in red:

/* ----- DO NOT EDIT ANYTHING ABOVE THIS LINE -------------------------------------------- */

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
* { color: red ;}

/* ----- DO NOT EDIT ANYTHING BELOW THIS LINE -------------------------------------------- */

PS: check the semicolon at the beginning of line 39?

PS2: you have 2 accounts, did you see John's post?
Quote
JohnHell
Off-topic: if you have troubles with your old account, I can set and send you a new password.



Edited 2 time(s). Last edit at 08/14/2019 08:36AM by siria.

Options: ReplyQuote
Re: userContent.css... / style browser XUL pages
Posted by: cpm1a_new
Date: August 14, 2019 10:02AM

>create a file "userChrome.css" in the same folder as adblock, make its format UFT-8, and restart
it works, thanks! history.xul looks now just the way i want it

>If you want to style all pages completely yourself, that's a very complicated project
it sure is. but i am pretty satisfied with what i already have.

1) but still i would like to set my own background/font colors for text input fields on all web pages. i want to type in white or RGB(221, 119, 0) on black background. i spent pretty much time trying, but didn't make it. what should i add/change in the adblock.css i uploaded to g-drive?

2) why do you use a very old KM version?

the semicolon at the beginning of line 39: thanks, it's OK (disabled, but not deleted)
John mailed me a new pass for the old account (it's gonna be a backup one)



Edited 2 time(s). Last edit at 08/14/2019 10:42AM by cpm1a_new.

Options: ReplyQuote
Re: userContent.css... / css howto
Posted by: siria
Date: August 14, 2019 12:21PM

Quote
cpm1a_new
1) but still i would like to set my own background/font colors for text input fields on all web pages. i want to type in white or RGB(221, 119, 0) on black background. i spent pretty much time trying, but didn't make it. what should i add/change in the adblock.css i uploaded to g-drive?

Your file is contradictive for input fields.
Near beginning you want them dark gray:
input, textarea {background-color: #333333 !important}

But further down you redefine it to the opposite, background white - and even give this 2x priority:
1) written further down 2) "important"
Then again: it should be background-color!
input, textarea, select {
background: White !important;
color: Black !important;
}

And afterwards redefine it again for most types, with background silver:
(although guess no effect without "-color"?)
button, input[type="file"], input[type="submit"], input[type="button"], input[type="reset"] {
background: Silver !important;
color: Black !important;
}

Not sure if perhaps you mean something like this?? (css pseudo-classes)
input::active, input::focus, textarea::-moz-selection {background-color: xxx

I've also found, if some style just refuses to work without reason, it helps in some cases to make the rules longer. That gives it a higher priority too:
input {xxxx
html body div input {xxxx

Is it normal to disable lines with a semicolon in front?
No idea, perhaps, have just never seen it. The usual way for disabled css stuff is /*....*/

2) only because it's the last version that runs stable on my very old main computer, no choice.



Edited 1 time(s). Last edit at 08/14/2019 12:31PM by siria.

Options: ReplyQuote
Re: userContent.css... / css howto
Posted by: cpm1a_new
Date: August 14, 2019 01:49PM

> i have absolutely no knowledge of CSS, so i just changed colors, NOT TOUCHING ANYTHING ELSE as long as it worked at the moment )))
that's why my CSS is contradictive

you can change/delete anything in it to set my own background/font colors for text input fields on all web pages. i want to type in white or RGB(221, 119, 0) on black background

is it possible?
thanks



Edited 1 time(s). Last edit at 08/14/2019 01:51PM by cpm1a_new.

Options: ReplyQuote
Re: userContent.css... / css howto
Posted by: JohnHell
Date: August 14, 2019 04:23PM

I don't know if in Goanna version still works. They are changing quite a few Gecko references:

input{
	-moz-appearance: none !important;
	color: white;
	background-color: black;
}
input[selected]{
	-moz-appearance: none !important;
	color: white;
	background-color: black;
}
textarea{
	-moz-appearance: none !important;
	color: white;
	background-color: black;
}

Note that here are separated, but they could be colon separated input, input[selected],textarea{}. But the above lets set different styles to different elements.


And don't avoid apply rules globally unless you know what that means. Do what siria posted. Rules for specific urls or domains. Check the Mozilla Developer Network pages that explain a lot of how to use them.



Edited 2 time(s). Last edit at 08/14/2019 04:30PM by JohnHell.

Options: ReplyQuote
Re: userContent.css... / css howto
Posted by: cpm1a_new
Date: August 14, 2019 05:05PM

Quote

I don't know if in Goanna version still works.
it does, thank you!



Edited 1 time(s). Last edit at 08/16/2019 07:35AM by cpm1a_new.

Options: ReplyQuote
Re: userContent.css... / css howto
Posted by: cpm1a_new
Date: August 23, 2019 04:51AM

@siria
my userContent.css for chrome://history/content/history.xul:

/* ----- DO NOT EDIT ANYTHING ABOVE THIS LINE -------------------------------------------- */

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"winking smiley;
* { color: RGB(221, 119, 0) ;}
* { background-color: Black ;}

/* ----- DO NOT EDIT ANYTHING BELOW THIS LINE -------------------------------------------- */

1) it works fine, thanx, only can i set my font/background colors for the View Button drop-down list? now it's black on black, so the menu items are not visible.

2) a very nice one btw, http://kmeleonbrowser.org/forum/read.php?2,140723,140723#msg-140723 , but...



Edited 2 time(s). Last edit at 08/23/2019 08:23AM by cpm1a_new.

Options: ReplyQuote
Re: userContent.css... / css howto
Posted by: hermes
Date: August 23, 2019 08:33AM

@cpm1a_new

Night mode)
*{color:#b0b0b0 !important; background:black !important}
a{color:#00bb00 !important}
a[href]:hover{color:#d8d8d8 !important; background:#006700 !important}


Options: ReplyQuote
Re: userContent.css... / css howto
Posted by: cpm1a_new
Date: August 23, 2019 08:45AM

@hermes

thanks



Edited 3 time(s). Last edit at 08/23/2019 12:42PM by cpm1a_new.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.