Last Comment Bug 1046166 - [e10s] userContent.css does not work
: [e10s] userContent.css does not work
Status: NEW
: regression
Product: Core
Classification: Components
Component: CSS Parsing and Computation (show other bugs)
: Trunk
: x86_64 Windows 7
: P1 normal with 20 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
: 1234188 (view as bug list)
Depends on:
Blocks: fxe10s
  Show dependency treegraph
 
Reported: 2014-07-30 08:19 PDT by Alice0775 White
Modified: 2016-03-21 10:00 PDT (History)
50 users (show)
benjamin: needinfo? (kev)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
+


Attachments

Description Alice0775 White 2014-07-30 08:19:42 PDT
https://hg.mozilla.org/mozilla-central/rev/f61a27b00e05
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0 ID:20140730030201
Comment 1 Chris Peterson [:cpeterson] 2014-07-30 09:58:49 PDT
Alice, is this userContent.css problem a regression from the changeset you link in comment 0? Is this really an IPC bug?
Comment 2 Alice0775 White 2014-07-30 10:19:00 PDT
(In reply to Chris Peterson (:cpeterson) from comment #1)
> Alice, is this userContent.css problem a regression from the changeset you
> link in comment 0? Is this really an IPC bug?

Sorry, I am not sure which component is best.
At least, the problem exists since Firefox25's e10s.
Comment 3 Ronan Jouchet 2014-12-15 07:24:13 PST
Hi.

As a Nightly user, I would like to help test e10s, but I am also a heavy user of userContent.css (rather than, say, Stylish, because it's baked into Firefox and dead simple to use), so I always end up reverting `browser.tabs.remote.autostart` each time e10s is pushed to me.

Also, userContent.css / userChrome.css look very much like the kind of [advanced + little-discoverable] feature that Mozilla might want to sever to reduce the configurable surface and encourage usage of an extension. This said (and sorry for the "ME TOO, and by the way I have a question" digression), is there a possibility this bug ends up WONTFIXed, or am I dreaming this up and it's unfixed simply because nobody had the time to look at it yet?
Comment 4 Ronan Jouchet 2015-01-14 05:53:01 PST
browser.tabs.remote.autostart.1 was set to true in today's Nightly 38.0a1 (2015-01-14), and I re-flipped it to false to have my userContent.css working.

Is the feature going to be supported at all in e10s?
Comment 5 Josh Matthews [:jdm] 2015-01-14 08:33:49 PST
That's the plan, it's just a much lower priority than all of the other work happening.
Comment 6 Bob49 2015-08-16 12:10:28 PDT
The Nightly and Aurora now

Directory "chrome" important for many people!

Me, forced to disable multi-process !
Comment 7 G_HZ 2015-08-16 13:12:05 PDT
Hello
With the update of Firefox Developer Edition 16-07-2015 42.0a2, chrome folder that contains userContent.css no longer works ...

To solve this regression, we must unfortunately disable multi-process mode for userContent.css is again considered.
Comment 8 David Baron [:dbaron] ⌚️UTC+1 (less responsive until April 4) 2015-08-16 13:24:33 PDT
If somebody wants to debug this, a good place to start would be nsLayoutStylesheetCache::InitFromProfile (in the content process).  My guess would be that something it does doesn't work in the content process.

https://hg.mozilla.org/mozilla-central/file/0876695d1abd/layout/style/nsLayoutStylesheetCache.cpp#l397
Comment 9 [out for a few weeks] Bill McCloskey (:billm) 2015-08-21 12:42:57 PDT
I think what's happening is that we don't know the location of the profile directory in the content process. That's to avoid accessing the file system, which will be forbidden once we have a full sandbox. I'm guessing we're returning here:
https://hg.mozilla.org/mozilla-central/file/0876695d1abd/layout/style/nsLayoutStylesheetCache.cpp#l414

I think we need to design something here that will send down the style data from the parent. Maybe we could load the style sheet text in the parent and send it down to each child upon startup. Does that seem reasonable David?
Comment 10 Ronan Jouchet 2015-08-21 14:02:28 PDT
(In reply to Bill McCloskey (:billm) from comment #9)
> I think what's happening is that we don't know the location of the profile
> directory in the content process. That's to avoid accessing the file system,
> which will be forbidden once we have a full sandbox. I'm guessing we're
> returning here:
> https://hg.mozilla.org/mozilla-central/file/0876695d1abd/layout/style/nsLayoutStylesheetCache.cpp#l414

Hi, I'm working on this bug (observers: no promises made! I'm not an employee and this is my first tentative at mozilla dev; just giving it a try, maybe I'll succeed and maybe not).

I didn't validate this and thought the child didn't have to pass through this code. With Bill's suggestion and now understanding a bit more about e10s, I'm going to validate this with logging. Logging is my only option for this, right? Reading the e10s/debugging wiki page [1] and mconley's blog post [2], I don't see a way to tell gdb to "attach to any child at nsLayoutStylesheetCache.cpp:l414" in order to catch such early initialization work. Wrong?

> I think we need to design something here that will send down the style data
> from the parent. Maybe we could load the style sheet text in the parent and
> send it down to each child upon startup. Does that seem reasonable David?

Also, how should non-e10s windows be covered? 
 a. Branch to keep using to the current code if in a non-e10s window.
 b. Do the kind of message-passing you describe in non-e10s windows too.

[1] https://wiki.mozilla.org/Electrolysis/Debugging
[2] http://mikeconley.ca/blog/2014/04/25/electrolysis-debugging-child-processes-of-content-for-make-benefit-glorious-browser-of-firefox/
Comment 11 David Baron [:dbaron] ⌚️UTC+1 (less responsive until April 4) 2015-11-08 18:16:33 PST
Bill is probably a better person to answer comment 10 than I am, although I could try...
Comment 12 David Baron [:dbaron] ⌚️UTC+1 (less responsive until April 4) 2015-11-08 18:19:19 PST
(In reply to Bill McCloskey (:billm) from comment #9)
> I think we need to design something here that will send down the style data
> from the parent. Maybe we could load the style sheet text in the parent and
> send it down to each child upon startup. Does that seem reasonable David?

I guess it does... although maybe we could instead piggy-back on the way we load the UA style sheets, which is with resource:// URLs.  Then again, maybe it's problematic that the resource: URLs for the UA sheets are (I think) in JARs, and these wouldn't be.
Comment 13 [out for a few weeks] Bill McCloskey (:billm) 2015-11-09 20:06:48 PST
We actually have some existing code to send style sheet loads down to the child process:
http://mxr.mozilla.org/mozilla-central/source/dom/ipc/ContentParent.cpp#2570
http://mxr.mozilla.org/mozilla-central/source/layout/base/nsStyleSheetService.cpp#160

David, is there a way we could use this code for userContent.css. I'm not familiar with all the loading mechanisms at play here.
Comment 14 David Baron [:dbaron] ⌚️UTC+1 (less responsive until April 4) 2015-11-09 21:53:44 PST
I don't think that helps with this (at least in the long term in terms of security models as you describe in comment 9), since that just sends a URI down to the content process, which it then invokes network code on, which goes back to the parent process to do the load.  Whereas here the content process already knows it needs to load a particular URI, it just needs a way to tell the parent process to load that URI in a way that the parent process can tell is safe.  I suppose that we could have the parent process get the profile directory, but it sounds like we don't want the child process to know where the profile directory is or have access to everything in it, so it seems better to have a special URI just for these two style sheets (userContent.css and userChrome.css).
Comment 15 [out for a few weeks] Bill McCloskey (:billm) 2015-11-10 09:13:33 PST
Maybe crazy, but could we just use a data: URL? It would be a lot easier. I doubt users are using gigantic style sheets here.
Comment 16 Ronan Jouchet 2015-11-10 09:19:17 PST
(In reply to Bill McCloskey (:billm) from comment #15)
> Maybe crazy, but could we just use a data: URL? It would be a lot easier. I
> doubt users are using gigantic style sheets here.

Hi. No idea how representative I am of the users of this feature, just providing one data point: after a few years of usage, my userContent.css has rules for ~30 web sites, and is 10kB.
Comment 17 Ronan Jouchet 2015-11-17 06:35:50 PST
Hi. Chiming in to add two things:

1. (Addressed to other users of the feature) Extension "dotjs" [1] is a 100%-"compatible" alternative to userContent.css. Just symlink your userContent.css to ~/.css/default.css and you're done. There are other ways to use the extension (e.g. one file per domain), but since it's fine with the `@-moz-document...` rules our userContent.css uses and supports this `default.css` special case that is loaded on all domains, it's feature-identical (and more) to userContent.css . One regression is that the css isn't instantly applied, on my machine there is a maybe ~500ms on load without the custom style, then it's applied.

2. (Addressed to potential developers of this bug) Actually, the extension is *better* than userContent.css, because changes to the custom css file don't require a Firefox restart, only a page reload. If work is done to restore the feature in e10s, it would be nice to not require a restart too. Or better, it would be *super* nice to monitor the css file and apply changes instantly (like Chrome's `User Stylesheet.css` used to do before the feature was axed)


[1] https://github.com/rlr/dotjs-addon , https://addons.mozilla.org/en-US/firefox/addon/dotjs/
Comment 18 gavenkoa 2015-12-24 08:20:54 PST
https://addons.mozilla.org/en-US/firefox/addon/dotjs/ is not signed

Even if so it never be look truster then core userContens.css Firefox feature...
Comment 19 David Baron [:dbaron] ⌚️UTC+1 (less responsive until April 4) 2015-12-24 08:34:26 PST
*** Bug 1234188 has been marked as a duplicate of this bug. ***
Comment 20 mkdante381 2016-01-27 13:50:20 PST
userChrome.css and userContent.css not work also on Firefox Aurora Developer Edition 46.0a2. Problem with add-on uc https://addons.mozilla.org/pl/firefox/addon/uc/
Comment 21 Jim Mathies [:jimm] 2016-02-02 14:17:23 PST
-> tracy for a qa report.
Comment 22 Tracy Walker [:tracy] 2016-02-04 08:21:37 PST
I put little style change in /Users/tracy/mozilla-central/obj-x86_64-apple-darwin13.3.0/dist/bin/browser/defaults/profile/chrome/useContent.css

/* Put a thin black border around all dropdown forms like NS4.x */
:-moz-dropdown-list {
  border: 5px solid black !important;
  border-top-style: solid !important;
}

I am not sure why/how, but this change is affecting all of my Firefox/Nightly installations. Anyway, the css works in non-e10s but fails to draw a small black border around form drop downs in e10s mode.

I tested with latest Nightly 47.0a1, 20160203030249 on Mac 10.9.5.  I can't figure out how to replicate on Windows or Linux, short of building Nightly, which I am not setup to do on those platforms.  

Also note:  I tried using Stylish and one of its basic/popular style changes and it does work in e10s.
Comment 23 Benjamin Smedberg [:bsmedberg] 2016-02-04 09:46:27 PST
Kev: I think we should drop support for userContent.css and suggest that people replace it with greasemonkey-like addons (this can be done using the addon SDK as well as webextensions). Can you confirm that decision and if so we'll morph this bug into removing userContent.css support in general in favor of an addon-based approach.
Comment 24 mkdante381 2016-02-05 00:27:49 PST
userchrome.css and usercontent.css are have more features. Greasemonkey is for web/javascript, but Stylish is for change web style and Firefox theme/style
Comment 25 Sören Hentzschel 2016-02-05 01:00:08 PST Comment hidden (advocacy)
Comment 26 h633537 2016-02-05 09:33:46 PST Comment hidden (abuse)
Comment 27 Laci 2016-02-05 10:32:14 PST Comment hidden (abuse)
Comment 28 Marko Karjalainen 2016-02-05 12:00:34 PST Comment hidden (advocacy)
Comment 29 VladDrakul 2016-02-05 14:58:26 PST Comment hidden (off-topic)
Comment 30 Kuan 2016-02-05 16:22:49 PST Comment hidden (off-topic)
Comment 31 Bob49 2016-02-06 02:11:41 PST Comment hidden (advocacy)
Comment 32 SpeciesX 2016-02-06 03:32:21 PST Comment hidden (off-topic)
Comment 33 gavenkoa 2016-02-06 05:21:23 PST Comment hidden (off-topic)
Comment 34 gavenkoa 2016-02-06 05:56:43 PST Comment hidden (off-topic)
Comment 35 Kamiru_ 2016-02-06 09:52:30 PST Comment hidden (off-topic)
Comment 36 Kamiru_ 2016-02-06 09:53:30 PST Comment hidden (off-topic)
Comment 37 avada 2016-02-06 10:39:17 PST
(In reply to Benjamin Smedberg  [:bsmedberg] from comment #23)
> Kev: I think we should drop support for userContent.css and suggest that
> people replace it with greasemonkey-like addons (this can be done using the
> addon SDK as well as webextensions). Can you confirm that decision and if so
> we'll morph this bug into removing userContent.css support in general in
> favor of an addon-based approach.

Maybe you could add "user script addons" instead of a third party addon for user scripts. Something that mostly just encapsulates a script and some metadata, that can be easily edited with a built in editor. (Which already exists: Scratchpad)
Comment 38 Josh Matthews [:jdm] 2016-02-06 11:09:30 PST Comment hidden (off-topic)
Comment 39 Krzysztof 2016-02-06 13:46:16 PST Comment hidden (off-topic)
Comment 40 mkdante381 2016-02-06 14:23:03 PST
I tested add-on UC and userchrome.css work great  
uc version 20160205 
https://addons.mozilla.org/pl/firefox/addon/uc/

More about this addon:
Allows you to run arbitrary custom scripts in specified chrome windows.
In short, userChromeJS + subscriptoverlayloader.js.
usercontent.css is for only web. Stylish is more powerful
Comment 41 samuel.hodgkins 2016-02-09 13:21:48 PST
I would like to say that while I am not currently using e10s, I do rely on userContent.css for in my opinion a rather critical part of my user experience that should not need an extension. I use a dark GTK theme, and one of the first things I noticed were the issues noted here: https://wiki.archlinux.org/index.php/firefox#Unreadable_input_fields_with_dark_GTK.2B_themes. While I do use Stylish for other things, I think that I should not need a browser extension/add-on in order to have a non-broken user experience when using a dark GTK theme.
Comment 42 u563290 2016-02-12 19:15:00 PST Comment hidden (advocacy)
Comment 43 u563290 2016-02-12 19:17:36 PST Comment hidden (advocacy, duplicate)
Comment 44 Eiichi 2016-02-14 23:06:33 PST
I don't know this is related to Bug 1221724 - Remove xulrunner from mozilla-central, userContent.css seems to work in the latest central with e10s.
Can anyone confirm?
Comment 45 Eiichi 2016-02-17 14:23:13 PST
> I don't know this is related to Bug 1221724 - Remove xulrunner from
> mozilla-central, userContent.css seems to work in the latest central with
> e10s.

userContent.css still does not work in the latest central.
I've rushed for a conclusion.
I'm sorry about my fault.
Comment 46 Jim Mathies [:jimm] 2016-03-18 07:32:42 PDT
Jeff, any opinion here? Tjis bug is currently caught in triage limbo waiting on feedback from Kev.
Comment 47 Jeff Griffiths (:canuckistani) (:⚡︎) 2016-03-21 10:00:45 PDT
(In reply to Jim Mathies [:jimm] from comment #46)
> Jeff, any opinion here? Tjis bug is currently caught in triage limbo waiting
> on feedback from Kev.

I think we should fix this instead of waiting for an add-ons plan that will require migration. This is a regression and there seems to be some ideas in the previous comments on how to fix it.

Note You need to log in before you can comment on or make changes to this bug.


Privacy Policy