Help with userContent.css Topic is solved
Moderator: trava90
Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
-
Walter Dnes
- Astronaut

- Posts: 714
- Joined: 2015-07-30, 20:29
- Location: Vaughan, ON, Canada
Help with userContent.css
Problem: Idiot webdesigners make web pages with faint grey fonts on glaring white background. They're driftng towards font foreground #FEFEFE and backgrounf #FFFFFF. For years I've had one dedicated "dark profile", with Advanced Night Mode extension active. However, I'm now running in to more and more webpaages where it simply doesn't work, e.g. https://rumblekraft.substack.com/p/the- ... settlement
My understanding is that putting a "userContent.css" file in the "chrome" directory might over-ride this. My stumbling steps so far...
1) the example "userContent.css" file does not mention requiring a "namespace" declaration
2) The example file refers me to https://www-archive.mozilla.org/unix/cu ... serContent for more info. Given how much Pale Moon has diverged from Firefox, is that site still relevant?
3) Here's my first attempt at "userContent.css"... which doesn't work. Any ideas?
font {
color: #FFFFFF !important;
background-color: #000000 !important;
}
In case you're wondering, yes, I want to set one dedicated profile to use heavy-handed methods to beat stupid webpages into submission.
One related item... is there an extension such that
* I'm in profile "A"
* I can right-click a URL and open it in profile "B"
My understanding is that putting a "userContent.css" file in the "chrome" directory might over-ride this. My stumbling steps so far...
1) the example "userContent.css" file does not mention requiring a "namespace" declaration
2) The example file refers me to https://www-archive.mozilla.org/unix/cu ... serContent for more info. Given how much Pale Moon has diverged from Firefox, is that site still relevant?
3) Here's my first attempt at "userContent.css"... which doesn't work. Any ideas?
font {
color: #FFFFFF !important;
background-color: #000000 !important;
}
In case you're wondering, yes, I want to set one dedicated profile to use heavy-handed methods to beat stupid webpages into submission.
One related item... is there an extension such that
* I'm in profile "A"
* I can right-click a URL and open it in profile "B"
There are 2 kinds of people in this world...
1) Those who can extrapolate from incomplete data
1) Those who can extrapolate from incomplete data
-
adoxa
- Astronaut

- Posts: 596
- Joined: 2019-03-16, 13:26
- Location: Qld, Aus.
Re: Help with userContent.css
Colors are associated with content, not fonts; try * instead of font. (BTW, that site seemed fine with Windows Basilisk.)
-
jars_
- Lunatic

- Posts: 429
- Joined: 2016-12-27, 00:12
Re: Help with userContent.css
Rough and ready (на скорую руку набросал)
+V2: width and font size
-
Walter Dnes
- Astronaut

- Posts: 714
- Joined: 2015-07-30, 20:29
- Location: Vaughan, ON, Canada
Re: Help with userContent.css
Yes. But the webmaster's definition of "fine" is rather hard on my eyes. Basically saying "It's not a bug, it's a feature".
There are 2 kinds of people in this world...
1) Those who can extrapolate from incomplete data
1) Those who can extrapolate from incomplete data
-
Walter Dnes
- Astronaut

- Posts: 714
- Joined: 2015-07-30, 20:29
- Location: Vaughan, ON, Canada
Re: Help with userContent.css
Thank you! It works. I didn't realize that it could be specified down to the domain. I'll do additional tweaking to get it to my exact tastes. Related questions...
1) Substack hosts a lot of personal websites, which may have different styles. Can I restrict further to subdomains, e.g.
Code: Select all
@-moz-document domain(rumblekraft.substack.com)Code: Select all
@-moz-document domain(rumblekraft.substack.com)
@-moz-document domain(lightreading.com)
@-moz-document domain(example.com)
Code: Select all
@-moz-document domain(*.*)Code: Select all
[class^='mainMenuContent']Code: Select all
.single-post-container5) Do you recommend the tutorial at https://www.w3schools.com/css/ ? I want to get away from asking for handholding with every minor detail.
There are 2 kinds of people in this world...
1) Those who can extrapolate from incomplete data
1) Those who can extrapolate from incomplete data
-
Moonchild
- Project founder

- Posts: 38923
- Joined: 2011-08-28, 17:27
- Location: Sweden
Re: Help with userContent.css
it might be an idea to include that in the -example.css...Walter Dnes wrote: ↑2025-07-26, 14:25I didn't realize that it could be specified down to the domain.
"There is no point in arguing with an idiot, because then you're both idiots." - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
-
jars_
- Lunatic

- Posts: 429
- Joined: 2016-12-27, 00:12
Re: Help with userContent.css
1,2,3 yes but...
4,5 yes: .someClass the same as [class='someClass'] #someID the same as [id='someID']
with [] you can use CSS Attribute Selectors Writing form is longer, but more possibilities.
with [] you can use CSS Attribute Selectors Writing form is longer, but more possibilities.
-
Kris_88
- Board Warrior

- Posts: 1171
- Joined: 2021-01-26, 11:18
Re: Help with userContent.css
-moz-document :
https://udn.realityripple.com/docs/Web/CSS/@document
CSS reference :
https://udn.realityripple.com/docs/Web/CSS/Reference
https://udn.realityripple.com/docs/Web/CSS/@document
CSS reference :
https://udn.realityripple.com/docs/Web/CSS/Reference
-
Walter Dnes
- Astronaut

- Posts: 714
- Joined: 2015-07-30, 20:29
- Location: Vaughan, ON, Canada
Re: Help with userContent.css
Thanks everybody for your help. I feel like a kid with a shiny new toy. I'll be playing with it the next few days. Given what I've learned so far, I've changed my strategy. Rather than one dedicated "all-dark" profile, I'll set userContent.css to work on specified websites in all profiles.
There are 2 kinds of people in this world...
1) Those who can extrapolate from incomplete data
1) Those who can extrapolate from incomplete data
-
jars_
- Lunatic

- Posts: 429
- Joined: 2016-12-27, 00:12
Re: Help with userContent.css
My green style for PM forum
+ if you install the CustomButtons extension, you can edit userChrome/userContent.css and see results without restarting the browser, with that btn↓
-
Walter Dnes
- Astronaut

- Posts: 714
- Joined: 2015-07-30, 20:29
- Location: Vaughan, ON, Canada
Re: Help with userContent.css
I'm trying tp come up with GENERIC "dark mode" CSS that will work across multiple websites. Here it is so far...
1) The text in paragraphs is white on black as desired. But the gaps between paragraphs have white background. Is there any generic method to make those area black? In other words, how do I refer to those areas?
2) I want to make the font size the greater of 20 px or whatever the website specifies. I have not been able to get "max()" or "clamp()" to work with "font-size:". What is the "magic incantation"?
There are 2 kinds of people in this world...
1) Those who can extrapolate from incomplete data
1) Those who can extrapolate from incomplete data
-
adoxa
- Astronaut

- Posts: 596
- Joined: 2019-03-16, 13:26
- Location: Qld, Aus.
Re: Help with userContent.css
1) You'd want div:has(+p), but unfortunately has is not implemented, so this will have to do:
2) Likewise, max & clamp are not implemented. I don't know how you'd do that.
Code: Select all
/* black background between p, sites.psu.edu & rumblekraft, resp. */
div[class~="entry-content"], div[class~="body"] {
background-color: black !important;
}
-
Kris_88
- Board Warrior

- Posts: 1171
- Joined: 2021-01-26, 11:18
Re: Help with userContent.css
max() and clamp() won't help here anyway. You want to increase the font size to 20 where they are smaller and leave the rest unchanged (i.e. as set by the site author). As far as I understand, this cannot be done by CSS, in general. There is no magic instruction to compare the values set by the site author with the number 20 and choose the maximum as the new value.
-
Walter Dnes
- Astronaut

- Posts: 714
- Joined: 2015-07-30, 20:29
- Location: Vaughan, ON, Canada
Re: Help with userContent.css
Thanks. Not what I wanted to hear, but at least I know I'm not missing something glaringly obvious.
There are 2 kinds of people in this world...
1) Those who can extrapolate from incomplete data
1) Those who can extrapolate from incomplete data
-
tellu-white
- Lunatic

- Posts: 296
- Joined: 2022-03-08, 22:02
- Location: Arad, Romania
Re: Help with userContent.css
After reading this post, I created an add-on that has this option.Walter Dnes wrote: ↑2025-07-26, 02:53One related item... is there an extension such that
* I'm in profile "A"
* I can right-click a URL and open it in profile "B"
Screenshots:
Right-click on the add-on button:
Click on the add-on button:
The "about:profiles" page before creating profiles with the add-on:
The "about:profiles" page after creating profiles with the add-on:
IMPORTANT!
The "about:profiles" page must be closed when creating a new profile with this add-on.
Right-click on a link in the Google Search results page + click on the "Open Link in Another Profile" option:
A list with the created profiles opens, allowing you to select one with which to open the link that was right-clicked:
The page associated with the link that was right-clicked was opened in the selected profile:
Next, I will delete ("remove") one of the three profiles created earlier (with right-click on the add-on button):
IMPORTANT!
The "about:profiles" page must be closed when removing a profile with this add-on.
IMPORTANT!
Before creating profiles and using them with this add-on, you must save the path to the Pale Moon app (in the "prefs.js" file) by right-clicking on the add-on button + clicking on the "Get the Path to Pale Moon app" option.
IMPORTANT!
When a profile is open, the add-on cannot be used to open another URL with the same profile because that profile is locked by the "parent.lock" file created by Pale Moon ( %APPDATA%\Moonchild Productions\Pale Moon\Profiles\XXXXXXXX.profile_01\parent.lock ).
Of course, other pages can be opened directly in the window of the opened profile.
To use the add-on to open another URL with the same profile, you must first close the Pale Moon window with that profile.
This behavior is identical to that resulting from using the "Launch profile in new browser" option in the "about:profiles" window, so it appears to be hardcoded into Pale Moon.
***
Download link
If you are interested in testing my add-on, you can download it here ( Open Link in Another Profile 2.3 ):
https://www.mediafire.com/file/f6pwwmrhsua9xg3/open_link_in_another_profile_2_3.zip/file
You do not have the required permissions to view the files attached to this post.
Telu (with a single L) was the name of the dog of one of my grandparents - when I was just a little boy.
He was a white dog of large size and very friendly.
He was a white dog of large size and very friendly.
-
tellu-white
- Lunatic

- Posts: 296
- Joined: 2022-03-08, 22:02
- Location: Arad, Romania
Re: Help with userContent.css
Another Option:
In the previous post, I did not mention how to open a profile without loading a specific page in it. To do this, use the "Open Custom URL in Custom Pale Moon Profile" option (after clicking the button) without entering a URL in the "prompt dialog" that opens.
Screenshots:
***************
IMPORTANT!
Before deleting ("removing") a profile, you must close any instances of Pale Moon that are using that profile. Otherwise, folders (files) created by that profile will remain after the profile is deleted.
In the previous post, I did not mention how to open a profile without loading a specific page in it. To do this, use the "Open Custom URL in Custom Pale Moon Profile" option (after clicking the button) without entering a URL in the "prompt dialog" that opens.
Screenshots:
***************
IMPORTANT!
Before deleting ("removing") a profile, you must close any instances of Pale Moon that are using that profile. Otherwise, folders (files) created by that profile will remain after the profile is deleted.
You do not have the required permissions to view the files attached to this post.
Telu (with a single L) was the name of the dog of one of my grandparents - when I was just a little boy.
He was a white dog of large size and very friendly.
He was a white dog of large size and very friendly.
-
jars_
- Lunatic

- Posts: 429
- Joined: 2016-12-27, 00:12
Re: Help with userContent.css
tellu-white With all my respect .., the method you proposed, it is "remove the tonsils through the ass" Technically, it is possible, but why???
Are you suggesting to load an entirely new profile just to apply the required CSS style for the website? Thats a fire from a cannon at sparrows; total overkill!
There are methods much simpler and less costly... but, if all of this is for the sake of practicing, honing skills, and just for fun - I applaud and completely withdraw all complaints. The main thing is, that such methods do not become the norm... too late.
Because "pulling out tonsils through the ass", has became the standard for modern coders and app creators.
- CustomButtons + btn upthere (i use it)
- Stylish-Custom | Pale Moon Add-ons
- Stylem
- SiteStyles
SfMBE
+ small upd in defense of CustomButtons and the wishes to integrate this extension into PaleMoon:
with CB to open loaded site url with others Profile we need something like this (8 lines)↓
(to open the link with a RMC it's roughly the same, just a couple of lines shorter)
Are you suggesting to load an entirely new profile just to apply the required CSS style for the website? Thats a fire from a cannon at sparrows; total overkill!
There are methods much simpler and less costly... but, if all of this is for the sake of practicing, honing skills, and just for fun - I applaud and completely withdraw all complaints. The main thing is, that such methods do not become the norm... too late.
Because "pulling out tonsils through the ass", has became the standard for modern coders and app creators.
- CustomButtons + btn upthere (i use it)
- Stylish-Custom | Pale Moon Add-ons
- Stylem
- SiteStyles
SfMBE
+ small upd in defense of CustomButtons and the wishes to integrate this extension into PaleMoon:
with CB to open loaded site url with others Profile we need something like this (8 lines)↓
(to open the link with a RMC it's roughly the same, just a couple of lines shorter)
-
tellu-white
- Lunatic

- Posts: 296
- Joined: 2022-03-08, 22:02
- Location: Arad, Romania
Re: Help with userContent.css
Si tacuisses, philosophus mansisses!
If you had read my first post here carefully, you would have seen that I posted this add-on in response to Walter Dnes' additional request ("one related item") at the end of his first post:
In addition, since I created an add-on that opens links in another profile, I also added options to EASILY create (and delete) profiles from which a user can EASILY select one when opening a link, depending on the context (see the explanation about the limitation imposed by the "parent.lock" file in my first comment). Also, my add-on removes tracking parameters from links in Google Search results pages (parameters added by Google every time you right-click a link).Walter Dnes wrote:
One related item... is there an extension such that
* I'm in profile "A"
* I can right-click a URL and open it in profile "B"
To implement all these options, you need a few more lines of code than the ones you posted.
Telu (with a single L) was the name of the dog of one of my grandparents - when I was just a little boy.
He was a white dog of large size and very friendly.
He was a white dog of large size and very friendly.
-
Walter Dnes
- Astronaut

- Posts: 714
- Joined: 2015-07-30, 20:29
- Location: Vaughan, ON, Canada
Re: Help with userContent.css
Thank you. I'll take a look at it.tellu-white wrote: ↑2025-07-28, 22:37After reading this post, I created an add-on that has this option.Walter Dnes wrote: ↑2025-07-26, 02:53One related item... is there an extension such that
* I'm in profile "A"
* I can right-click a URL and open it in profile "B"
There are 2 kinds of people in this world...
1) Those who can extrapolate from incomplete data
1) Those who can extrapolate from incomplete data
-
tellu-white
- Lunatic

- Posts: 296
- Joined: 2022-03-08, 22:02
- Location: Arad, Romania
Re: Help with userContent.css
I've made a new version of this add-on (3.1) in which I've removed the need to save the Pale Moon application path with "Right-Click / Get the Path to Pale Moon app". I was able to remove this requirement after coming across a hard-to-find line of code (hard-to-find argument = XREExeF):
I assume that the letter F at the end of the argument "XREExeF" stands for Firefox. I also assume that the string "Exe" refers to an executable file.
I've tested the code on "Windows 7 32-bit" and "Linux Mint 19.3 Cinnamon 32-bit", and it worked (even though in Linux, Pale Moon executable does not have the "exe" extension).
***
I've made another change, namely for cases where you want to open a profile without a specific page in it. Thus, when using the "Open Custom URL in Custom Pale Moon Profile" option, if you leave the "prompt dialog" that opens blank (see my previous post), the new code will open the selected profile with the URL "about:blank". This change was necessary because without it, in Linux the new profile would open with the URL "file:///home/mint/".
Download link ( Open Link in Another Profile 3.1 ):
https://www.mediafire.com/file/owoqxjo8271sh9k/open_link_in_another_profile_3_1.zip/file
***
P.S.
By the way, your code did not work in "Linux Mint 19.3 Cinnamon 32-bit." The "CurWorkD" argument points to the wrong path "home/mint" instead of the correct path "usr/lib/palemoon"! I tested the code you posted with "custom_buttons-0.0.5.8.9-fixed8".
Screenshots:
Code: Select all
var process_Pale_Moon = Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
process_Pale_Moon.init(Services.dirsvc.get("XREExeF", Components.interfaces.nsIFile));
I've tested the code on "Windows 7 32-bit" and "Linux Mint 19.3 Cinnamon 32-bit", and it worked (even though in Linux, Pale Moon executable does not have the "exe" extension).
***
I've made another change, namely for cases where you want to open a profile without a specific page in it. Thus, when using the "Open Custom URL in Custom Pale Moon Profile" option, if you leave the "prompt dialog" that opens blank (see my previous post), the new code will open the selected profile with the URL "about:blank". This change was necessary because without it, in Linux the new profile would open with the URL "file:///home/mint/".
Download link ( Open Link in Another Profile 3.1 ):
https://www.mediafire.com/file/owoqxjo8271sh9k/open_link_in_another_profile_3_1.zip/file
***
P.S.
jars_ wrote:
small upd in defense of CustomButtons and the wishes to integrate this extension into PaleMoon:
with CB to open loaded site url with others Profile we need something like this (8 lines)
Code: Select all
function pmProfSelect(ico) {
const cwd = Services.dirsvc.get('CurWorkD', Ci.nsIFile), tmp = Services.dirsvc.get('TmpD', Ci.nsIFile);
progPath = cwd.path + "\\palemoon.exe";
if(ico==1) { return "moz-icon://file://" + progPath }
let prof_tmp = tmp.path + "\\PM_prof_tmp_" + Math.random();
arg = ["-no-remote", "-profile", prof_tmp, gBrowser.currentURI.spec];
btnFunc.startProcess(progPath, arg);
};
Screenshots:
You do not have the required permissions to view the files attached to this post.
Telu (with a single L) was the name of the dog of one of my grandparents - when I was just a little boy.
He was a white dog of large size and very friendly.
He was a white dog of large size and very friendly.