Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

where can you find the embedded Firefox pages? I would like to modify them on my computer.

more options

I want to modify the Session Restore page. Where do I find it to modify?

I want to modify the Session Restore page. Where do I find it to modify?

Chosen solution

Hi Foxwod, common.css is a built-in style sheet internal to the omni.ja file. You want to supplement or override the built-in style sheets with userContent.css.

The only time Firefox should completely ignore a userContent.css file in the chrome folder is if it is starting up in Firefox's "Safe Mode", which definitely is not the typical configuration.

Read this answer in context 👍 0

All Replies (20)

more options

Hi, there is no Session Restore page. It is either on or off from Options. What is it you would like to do ?

more options
more options

I want to remove the "Start New Session" button.

Modified by Foxwod

more options

Built-in pages are generated from a combination of HTML, JavaScript, CSS, and sometimes an older layout language called XUL. These files are mostly combined into a large archive called omni.ja. That file is replaced with every Firefox update, so it's not very practical to make edits to it.

What do you want to change about the page? If it's a matter of moving or hiding or resizing things, possibly custom style rules could do the job. I created this example earlier this year for someone who kept accidentally starting a new session. I can't find the thread now, but this could have been the code (it would be for a userContent.css file):

/* Tweaks for Session Restore page */
@-moz-document url("about:sessionrestore") {
  #errorTryAgain { /* Huge Restore Button */
    width: 100% !important;
    height: 8em !important;
    border-radius: 8px !important;
    margin-bottom: 8em !important;
  }
  #errorCancel { /* Small New Session Button*/
    min-width: 30px !important;
    max-width: 30px !important;
    padding: 0 !important;
  }
  div.tree-container { /* Taller Tabs List */
    min-height: 450px !important;
  }
  div.container { /* More Width for tab titles */
    max-width: 1600px !important;
    margin: 0 !important;
  }
}

The old "Before" and "After" screenshots attached for illustration.

Modified by jscher2000 - Support Volunteer

more options

where is the userContent.css file found. Let me guess... It's in the omni.ja file that I have no idea how to get into. :(

I like how you set up the page. Less chance of hitting the wrong button.

It looks like I have to add userContent.css to the appropriate place in .mozilla.

This looks like how you go about adding userContent.css. Check and see if sounds right, please? https://www.howtogeek.com/334716/how-to-customize-firefoxs-user-interface-with-userchrome.css/

I'll try it when I get home.

Modified by Foxwod

more options

The userContent.css file is an optional file that does not exist by default. It lives in the same folder as the optional userChrome.css file -- chrome being for the user interface, and content being for the web page area.

If you follow the steps to set a userChrome.css file, then you'll be 99% of the way to a userContent.css file.

more options

jscher2000 said

The userContent.css file is an optional file that does not exist by default. It lives in the same folder as the optional userChrome.css file -- chrome being for the user interface, and content being for the web page area. If you follow the steps to set a userChrome.css file, then you'll be 99% of the way to a userContent.css file.

Thanks, soon as I get home I will be playing with the userContent.css file. I will post what I learn.

more options
more options

I tried your script first off with no change in the Restore Session page.

I started cutting it down to bare bone and a few tweaks. No change to the page. userContent.css is in the chrome folder in the profile folder of .mozilla.

I don't see where I went wrong.

/* Tweaks for Session Restore page */ @-moz-document domain("about:SessionRestore") {

 #errorTryAgain { /* Huge Restore Button */
   width: 100px !important;
   height: 50px !important;
   border-radius: 8px !important;
   margin-bottom: 8em !important;
 }
 #errorCancel { /* Small New Session Button*/
   min-width: 30px !important;
   max-width: 30px !important;
   padding: 0 !important;
 }

}

more options

Hi Foxwod, two things:

(1) "userContent.css is in the chrome folder in the profile folder of .mozilla"

Is that where your currently active profile is located? You can verify by fresh dates on data files such as places.sqlite.

(2) "@-moz-document domain("about:SessionRestore") {"

The URL is case sensitive, so at least on Windows, it needs to be all lower case:

@-moz-document domain("about:sessionrestore") {

Also: about:sessionstore is a page address, not a domain, so it needs to be:

@-moz-document url("about:sessionrestore") {


To confirm that the file is being read, you could try another rule that creates a highly visible change. This one colors the backgrounds of alternating rows on the Add-ons page blue (or gray for inactive ones):

/* Add-ons page color striping */
@-moz-document url("about:addons") {
  #addon-list richlistitem[active="true"]:nth-child(even) {
    background-color: #e0f0ff !important;
  }
  #addon-list richlistitem[active="false"]:nth-child(even) {
    background-color: #f4f4f4 !important;
  }
}

Modified by jscher2000 - Support Volunteer

more options

1) Yes Date is today

2) Checking on the domain now'

more options

No changes to the addons page, saying that userContent.css is not being read?

more options

chrome folder is lower case, and userContent.css is spelled with one uppercase letter.

Modified by Foxwod

more options

Also using Firefox Quantum 61.0.2 (64 bit)

more options

I don't see in the Restore Session page where it looks for css.

more options

If I understand the Linux file layout, your file is here:

~/.mozilla/firefox/[profile]/chrome/userContent.css

I can't explain why Firefox isn't finding/using it. Firefox should read [profile]/chrome/userContent.css at startup and apply the rules from that point forward for the rest of the session. (Any edits made after the session starts are not observed until the next session.)

more options

Foxwod said

I don't see in the Restore Session page where it looks for css.

I'm not sure Firefox's developer tools show userContent.css in the Style Editor panel unless you first find a styled element in the Inspector and click userContent.css in the Rules pane (example attached). Seems inconsistent.

more options

That is where the file is.

~/.mozilla/firefox/[profile]/chrome/userContent.css

I have been loading new sessions of Firefox with each change.

Googling to see if Linux follows a different order, with no luck.

Modified by Foxwod

more options

Ok, I found this on the Restore Sessions page. So do I need to use aboutSessionRestore.css ?

<title>&restorepage.tabtitle;</title> <link rel="stylesheet" href="chrome://global/skin/in-content/info-pages.css" type="text/css" media="all"> <link rel="stylesheet" href="chrome://browser/skin/aboutSessionRestore.css" type="text/css" media="all"> <link rel="icon" type="image/png" href="chrome://global/skin/icons/warning-16.png"> <script type="application/javascript" src="chrome://browser/content/aboutSessionRestore.js"> </head> </p></script>

more options

Foxwod said

Ok, I found this on the Restore Sessions page. So do I need to use aboutSessionRestore.css ?

That is the name of Firefox's built-in style sheet, but you can't override it by using that name, the @-moz-document rule needs the page address.

You also could try without using the @-moz-document rule at all -- it is very unlikely that these button IDs are used in other pages, so we don't have to worry about styling things we don't want to style.

So then the entire contents of your userContent.css file would be:

  #errorTryAgain { /* Huge Restore Button */
    width: 100px !important;
    height: 50px !important;
    border-radius: 8px !important;
    margin-bottom: 8em !important;
  }
  #errorCancel { /* Small New Session Button*/
    min-width: 30px !important;
    max-width: 30px !important;
    padding: 0 !important;
  }

You know, I just noticed that somehow your @-moz-document rule changed from a url() rule to a domain() rule. So that would definitely explain why the rule wasn't working. Sorry for not noticing that before. I'm going to retroactively edit that into my earlier reply in case anyone else follows this thread in the future.

  1. 1
  2. 2