X
Nhấn vào đây để đến phiên bản di động của trang web.

Diễn đàn trợ giúp

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

Được đăng

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?

Giải pháp được chọn

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.

Đọc câu trả lời này trong ngữ cảnh 0

Chi tiết hệ thống bổ sung

Ứng dụng

  • Chuỗi đại diện người dùng: Mozilla/5.0 (X11; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0

Thông tin chi tiết

Shadow110 1072 giải pháp 14836 câu trả lời
Được đăng

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

Hi, there is no Session Restore page. It is either on or off from Options. What is it you would like to do ?
McCoy
  • Top 10 Contributor
522 giải pháp 4913 câu trả lời
Được đăng
In addition to the above, see : https://support.mozilla.org/en-US/kb/how-do-i-restore-my-tabs-last-time and : https://www.ghacks.net/2013/06/03/how-to-restore-firefox-sessions-if-session-restore-is-not-working-correctly/ (updated April 09, 2018 )

Người tạo câu hỏi

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

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

Được chỉnh sửa bởi Foxwod vào

jscher2000
  • Top 10 Contributor
8642 giải pháp 70695 câu trả lời
Được đăng

Câu trả lời hữu ích

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.

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): <pre>/* 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; } } </pre> The old "Before" and "After" screenshots attached for illustration.

Được chỉnh sửa bởi jscher2000 vào

Người tạo câu hỏi

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.

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.

Được chỉnh sửa bởi Foxwod vào

jscher2000
  • Top 10 Contributor
8642 giải pháp 70695 câu trả lời
Được đăng

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.

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. * http://kb.mozillazine.org/UserContent.css * https://www.userchrome.org/how-create-userchrome-css.html

Người tạo câu hỏi

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.

''jscher2000 [[#answer-1145460|said]]'' <blockquote> 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. * http://kb.mozillazine.org/UserContent.css * https://www.userchrome.org/how-create-userchrome-css.html </blockquote> Thanks, soon as I get home I will be playing with the userContent.css file. I will post what I learn.
cor-el
  • Top 10 Contributor
  • Moderator
17424 giải pháp 157436 câu trả lời
Được đăng
See also: *https://dxr.mozilla.org/mozilla-release/source/browser/components/sessionstore/content/aboutSessionRestore.xhtml

Người tạo câu hỏi

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;
 }

}

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; } }
jscher2000
  • Top 10 Contributor
8642 giải pháp 70695 câu trả lời
Được đăng

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;
  }
}
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) "<code>@-moz-document domain("about:SessionRestore") {</code>" The URL is case sensitive, so at least on Windows, it needs to be all lower case: <s><code>@-moz-document domain("about:sessionrestore") {</code></s> '''Also:''' about:sessionstore is a page address, not a domain, so it needs to be: <code>@-moz-document '''url("about:sessionrestore")''' {</code> ---- 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): <pre>/* 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; } } </pre>

Được chỉnh sửa bởi jscher2000 vào

Người tạo câu hỏi

1) Yes Date is today

2) Checking on the domain now'

1) Yes Date is today 2) Checking on the domain now'

Người tạo câu hỏi

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

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

Người tạo câu hỏi

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

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

Được chỉnh sửa bởi Foxwod vào

Người tạo câu hỏi

Also using Firefox Quantum 61.0.2 (64 bit)

Also using Firefox Quantum 61.0.2 (64 bit)

Người tạo câu hỏi

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

I don't see in the Restore Session page where it looks for css.
jscher2000
  • Top 10 Contributor
8642 giải pháp 70695 câu trả lời
Được đăng

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.)

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.)
jscher2000
  • Top 10 Contributor
8642 giải pháp 70695 câu trả lời
Được đăng

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.

''Foxwod [[#answer-1145737|said]]'' <blockquote> I don't see in the Restore Session page where it looks for css. </blockquote> 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.

Người tạo câu hỏi

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.

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.

Được chỉnh sửa bởi Foxwod vào

Người tạo câu hỏi

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

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

</script>

Ok, I found this on the Restore Sessions page. So do I need to use aboutSessionRestore.css ? <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <head> <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>
jscher2000
  • Top 10 Contributor
8642 giải pháp 70695 câu trả lời
Được đăng

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.

''Foxwod [[#answer-1145755|said]]'' <blockquote> Ok, I found this on the Restore Sessions page. So do I need to use aboutSessionRestore.css ? </blockquote> 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: <pre> #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; } </pre> ''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.''