Weird behaviour after usercontent edit

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.
Please direct questions that are Mac or Linux-specific (dealing with installation and OS integration) to the appropriate Linux or Mac board.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only. The main focus here is on Pale Moon on Windows. Please direct your questions that are specific for Linux and Mac to the dedicated boards for those operating systems.
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!
Locked
damamm

Weird behaviour after usercontent edit

Post by damamm » 2014-08-20, 23:42

Greetings,

I've been experiencing a weird bug (or unintended effect, I'm not sure) after applying a userChrome.css userContent.css change - which I'd like very much to keep (or find an alternative that does what it is supposed to do).

The change in question is only:
browser { background-color: #000 !important; }


The change is:
@-moz-document url-prefix(about:blank) {*{background-color:#000000;}}

Which basically makes the about:blank page black.
This works differently than simply setting the default background color in Options>Content>Colors because it doesn't make the actual background on pages itself black (which breaks several layouts and I wouldn't want).
So, this works well for that... but this side effect started happening:
left: I'm typing as usual<br />right: suddenly, after some random key, that happens.
left: I'm typing as usual
right: suddenly, after some random key, that happens.
It happens on several text boxes (but not all, like here), including gmail's on the picture above.
As I'm writing text normally, after some random key the other lines get completely black. Sometimes the entire box that black. If I just ctrl-z (and go back a word), I can continue writing normally a few more words until it happens again. Pretty random, but often.

So, would anyone have an alternative to that edit, or know of a way to prevent the lines from blacking out with this?

Thanks in advance!

oh yeah, PM 2.7.1 x64 (but this did happen on previous versions as well), win7 x64.
Last edited by damamm on 2014-08-21, 02:52, edited 2 times in total.

User avatar
ron_1
Moon Magic practitioner
Moon Magic practitioner
Posts: 2395
Joined: 2012-06-28, 01:20

Re: Weird behaviour after userchrome edit

Post by ron_1 » 2014-08-21, 00:27

If I understand correctly, I think this is what you want (can anyone confirm?):

Go to about:config, type in browser.display.background_color and set the color there.

BTW, I think black is #000000

mikeysc

Re: Weird behaviour after userchrome edit

Post by mikeysc » 2014-08-21, 00:58

browser.display.background_color does work; gives black background on new tab without a page loaded.
And 3 zeroes is shorthand version, good for any color where all 3 are the same e.g. (999, CCC, FFF), been used for a long time; it works as long as the browser processes it correctly and I think most still do.

buggy

Re: Weird behaviour after userchrome edit

Post by buggy » 2014-08-21, 01:21

damamm wrote:The effect I want from it is: to make the empty background that shows quickly before a page is loaded to be black instead of white (such as when you ctrl+click on a bookmark and before any content is loaded).
The color you want to change is for about:blank not for the background of a web page, see here if it can help you: http://forum.palemoon.org/viewtopic.php?f=3&t=5170

damamm

Re: Weird behaviour after userchrome edit

Post by damamm » 2014-08-21, 02:11

Thanks for the answers so far.
helloimustbegoing wrote:If I understand correctly, I think this is what you want (can anyone confirm?):

Go to about:config, type in browser.display.background_color and set the color there.
This has the adverse effect of breaking websites dependant on white background.

example:
good white background
good white background
broken black background
broken black background
so it's not a viable solution.
buggy wrote:The color you want to change is for about:blank not for the background of a web page, see here if it can help you: http://forum.palemoon.org/viewtopic.php?f=3&t=5170
haha that's actually my topic from some time ago.

I do have a modification for my about:blank to look black, but this one is different. It's the empty page that is quickly shown before some other page finishes loading (such as when you ctrl-click on your bookmarks).
Changing the about:blank doesn't affect that.

buggy

Re: Weird behaviour after userchrome edit

Post by buggy » 2014-08-21, 02:22

So the modification you have done does not work, use Stylish.

damamm

Re: Weird behaviour after userchrome edit

Post by damamm » 2014-08-21, 02:50

Did some more testing...
turns out the actual culprit is the userContent.css edit
@-moz-document url-prefix(about:blank) {*{background-color:#000000;}}


I hadn't thought of that before since it makes no sense for me =/
fixed original post.

buggy

Re: Weird behaviour after usercontent edit

Post by buggy » 2014-08-21, 03:23

I did not understand if your problem is solved?, but if yes you should edit the title of your thread please. If not Matt A. Tobin gave you an explanation and i gave you a solution but if you do not want to use an add-on you make as you prefer of course.

damamm

Re: Weird behaviour after usercontent edit

Post by damamm » 2014-08-21, 05:09

The problem persists.
It makes no sense to use a moderately heavy addon just to edit something this simple, so I won't. Thanks but I'm still looking for other alternatives.

buggy

Re: Weird behaviour after usercontent edit

Post by buggy » 2014-08-21, 05:43

Infact i just seen that is my theme and not Stylish which color this transitory background, but as i have choosen the same color for about:blank i was wrong houla :P
I must search how it is made...

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 29243
Joined: 2011-08-28, 17:27
Location: Tranås, SE
Contact:

Re: Weird behaviour after userchrome edit

Post by Moonchild » 2014-08-21, 08:57

damamm wrote:This has the adverse effect of breaking websites dependant on white background.
This means the websites in question need to design their pages properly (i.e.: setting a background color for their BODY element instead of relying on the assumption that browsers use white by default).
If it breaks for you, it will break for anyone that doesn't use white as a default page background color (some browsers use the system workspace color dependent on OS theme, some use grey, etc. all of that will not work).

Trying to use @-moz-document is tricky. As you have found out the hard way, -moz-document is used internally by the browser in other places, and your -url-prefix selector obviously doesn't work the way you intended.

A much simpler solution is setting your new tab page to a custom URL in browser.newtab.url (hint: use a file:// URL to point to a local HTML file). That file can be a black solid, gradient, image, custom content, whatever you wish.
"Son, in life you do not fight battles because you expect to win, you fight them merely because they need to be fought." -- Snagglepuss
Image

buggy

Re: Weird behaviour after userchrome edit

Post by buggy » 2014-08-22, 07:55

I think i do not understand all in this thread... i see that the first post was edited a second time and it seems that now the question is no longer the same, now "the empty background that shows quickly before a page is loaded" has disapeared... not simple ;) Thanks for explanations Moonchild, i am curious to see if that solves this strange behaviour... but i must admit i have a doubt :P

PS: Btw to avoid confusion in any case always better to provide example links we can test.

damamm

Re: Weird behaviour after usercontent edit

Post by damamm » 2014-08-24, 06:06

After doing some more research on this, as well as trying Moonchild's suggestion of using a local html file, I decided to just settle for the bug instead.

Using a local html file for newtabs works very badly since it won't focus on the address bar when I open a new tab.
Other solution would be to just give up on the black background, but ouch my eyes!

So the bug it is. At least I did manage to make the bug consistent, as in, it doesn't happen randomly as I type, but always. By forcing the text color to white on black background in about:blank, at least I'll be able to write stuff.
I'm still puzzled as to how the hell random text boxes relies on about:blank's formatting, but whatever.
btw, the usercontent.css I'm using for that is:
@-moz-document url-prefix(about:blank) {*{background-color:#000000 !important; color:#ffffff !important}}

Thanks.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 29243
Joined: 2011-08-28, 17:27
Location: Tranås, SE
Contact:

Re: Weird behaviour after usercontent edit

Post by Moonchild » 2014-08-24, 09:39

damamm wrote:I'm still puzzled as to how the hell random text boxes relies on about:blank's formatting, but whatever.
Like I said, your url selector obviously doesn't work as you expect on a -moz-document. about:blank is a special case that does odd things sometimes and nobody seems to know why.

As for the focus, that was changed on purpose since normally, people setting a specific URL as their new tab page would want it focused (it's assumed it has specific content that people want to work with); for example: automatically focusing a search box on that page so they can immediately start typing.
It takes one keystroke to focus the address bar (F6).
"Son, in life you do not fight battles because you expect to win, you fight them merely because they need to be fought." -- Snagglepuss
Image

damamm

Re: Weird behaviour after usercontent edit

Post by damamm » 2014-08-24, 15:34

Wow, people actually want that? You've no idea how I hate pages that "steal" focus, such as google or ddg, which is the sole reason I don't use them (or any page) as homepage.
If I'm opening my browser or a new tab I thought it was obvious I'd want to start typing an address immediately...

Supernova

Re: Weird behaviour after usercontent edit

Post by Supernova » 2014-08-24, 16:17

If you use the new tab page like that, about:blank or about:newtab are good for you. But if you just want to type an adress, why would you EVER set the new tab page to something else, uh ?
Of course search engine new tab page take focus for their search, it would be nonsensical to use them as new tab page otherwise.

buggy

Re: Weird behaviour after usercontent edit

Post by buggy » 2014-09-11, 10:12

Found the solution for "the empty background that shows quickly before a page is loaded"..., generously provided by my prefered dev. The most easy way is to use Stylish but not obliged, you can use userChrome.css instead. But easily activated/desactivated with Stylish etc... ( in this example the color is dark but of course you can change it ).

Code: Select all

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

.tabbrowser-tabbox{
  background: rgb(0,0,0) !important;
}
I am not sure this is useful but that's what it was originally requested.

Locked