Page 1 of 1
Weird behaviour after usercontent edit
Posted: 2014-08-20, 23:42
by damamm
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
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.
Re: Weird behaviour after userchrome edit
Posted: 2014-08-21, 00:27
by ron_1
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
Re: Weird behaviour after userchrome edit
Posted: 2014-08-21, 00:58
by mikeysc
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.
Re: Weird behaviour after userchrome edit
Posted: 2014-08-21, 01:21
by buggy
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
Re: Weird behaviour after userchrome edit
Posted: 2014-08-21, 02:11
by damamm
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

- broken black background
so it's not a viable solution.
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.
Re: Weird behaviour after userchrome edit
Posted: 2014-08-21, 02:22
by buggy
So the modification you have done does not work, use Stylish.
Re: Weird behaviour after userchrome edit
Posted: 2014-08-21, 02:50
by damamm
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.
Re: Weird behaviour after usercontent edit
Posted: 2014-08-21, 03:23
by buggy
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.
Re: Weird behaviour after usercontent edit
Posted: 2014-08-21, 05:09
by damamm
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.
Re: Weird behaviour after usercontent edit
Posted: 2014-08-21, 05:43
by buggy
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
I must search how it is made...
Re: Weird behaviour after userchrome edit
Posted: 2014-08-21, 08:57
by Moonchild
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.
Re: Weird behaviour after userchrome edit
Posted: 2014-08-22, 07:55
by buggy
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
PS: Btw to avoid confusion in any case always better to provide example links we can test.
Re: Weird behaviour after usercontent edit
Posted: 2014-08-24, 06:06
by damamm
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.
Re: Weird behaviour after usercontent edit
Posted: 2014-08-24, 09:39
by Moonchild
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).
Re: Weird behaviour after usercontent edit
Posted: 2014-08-24, 15:34
by damamm
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...
Re: Weird behaviour after usercontent edit
Posted: 2014-08-24, 16:17
by Supernova
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.
Re: Weird behaviour after usercontent edit
Posted: 2014-09-11, 10:12
by buggy
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.