User stylesheet not loading in Firefox 3

RESOLVED INVALID

Status

()

RESOLVED INVALID
11 years ago
11 years ago

People

(Reporter: h, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0

In Firefox 2, I used the Accessibility toolbar to install a user stylesheet. That toolbar doesn't work in Firefox 3, so it's gone. Now my user styles don't work. I checked in about:config that accessext.styles.userStylesheet.enable is true and that accessext.styles.userStylesheet.text contains the correct CSS code, but Firefox is simply not applying it.

I tried using the Web Developer Toolbar, but when I turn Persist mode on, it prompts me for the location of my CSS file every time I load a new page, so that's no good.

Here's the original CSS:

/* Distinguish visited links at www.washingtonpost.com */

@-moz-document domain("www.washingtonpost.com") {
  a:visited {
    color: purple ! important;
  }
}

@-moz-document domain("newsweek.washingtonpost.com") {
  a:visited {
    color: purple ! important;
  }
}

body #comics_wrapper2 a:visited {
	color: purple ! important;
}

I created this because washingtonpost.com, amazingly, styles its links NOT to turn color after being visited, so that I can't tell which articles I've read already.

This is exactly the code I found at accessext.styles.userStylesheet.text (except that the line breaks had been stripped out).

I also tried an instruction I found to name my CSS file as userContent.css and to put it into my Firefox profile directory, but it was still ignored.

To troubleshoot, I replaced the stylesheet and the setting at accessext.styles.userStylesheet.text with much simpler CSS and tried it out on a simple web page to show that it wasn't just a matter of looking at pages where new markup was interfering with assumptions about the cascade, but it really just isn't being used. Even Firebug doesn't indicate that my user stylesheet is being used.


Reproducible: Always

Steps to Reproduce:
1.
2.
3.
(Reporter)

Comment 1

11 years ago
To be more specific about my follow-up test, I just put the following CSS into the accessext.styles.userStylesheet.text property in my Firefox 3:

body { font-style: italic; } a:link { text-decoration: none; color: green; } a:visited { text-decoration: none; color: magenta; }

My test HTML file looks like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

	<head>
		<title>User CSS Test</title>
	</head>

	<body>
		<p>I just put the following CSS into the accessext.styles.userStylesheet.text property in my Firefox 3:</p>
		<p>body { font-style: italic; } a:link { text-decoration: none; color: green; } a:visited { text-decoration: none; color: magenta; }</p>
		<p>Here's a <a href="http://www.mozilla.org/">link to Mozilla</a>. All this text should be in italics, and the link should be green or magenta (at least, when the focus or hover isn't on it).</p>
	</body>

</html>

The text is not in italics and the link is still blue or purple, not green or magenta.

Comment 2

11 years ago
accessext.styles.userStylesheet.text looks like something used by the Accessibility Toolbar extension (https://addons.mozilla.org/en-US/firefox/addon/5809).  If the extension isn't working, that preference won't work either.  Try using Stylish instead for now (https://addons.mozilla.org/en-US/firefox/addon/2108).
Status: UNCONFIRMED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → INVALID
(Reporter)

Comment 3

11 years ago
Until now I had no reason to think that the Accessibility Toolbar's functionality in this area was anything other than a wrapper around a built-in Firefox feature. If Firefox has never had a user stylesheet feature natively, I'm astonished and frankly appalled!
(Reporter)

Comment 4

11 years ago
Oh, and thanks for pointing me to Stylish.

Comment 5

11 years ago
Firefox does have native user stylesheet features: usercontent.css and nsStyleSheetService.  I believe Stylish uses the latter, and I hope the Accessibility Toolbar does as well.
(Reporter)

Comment 6

11 years ago
I tried usercontent.css before and just tried it again. I put it into my Firefox profiles in both the Local and Roaming sections. No good. If it *is* supposed to work, well, it isn't, so either the instructions are incomplete or I've missed something or there's a bug after all.

Comment 7

11 years ago
You have to put usercontent.css in the chrome subdirectory of your Firefox profile directory.  There should be a "usercontent-example.css" file there.
(Reporter)

Comment 8

11 years ago
Ah. Either I'd overlooked that or it wasn't in the resource where I'd learned about usercontent.css. Thanks.
You need to log in before you can comment on or make changes to this bug.