Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

How to change the css of addons-pages

  • 6 trả lời
  • 1 gặp vấn đề này
  • 34 lượt xem
  • Trả lời mới nhất được viết bởi thomasvonderelbe

more options

Hey there,

How can I change the css of pages created by an addon?

(Example-URL: moz-extension://285d678c-ecb3-4003-923d-835fc9d8e0bc/reader.html)

I know how to change normal pages css via different tools like Stylus etc. (or via userContent.css). But this does not work for pages created by addons.

Can you please help me?

Hey there, How can I change the css of pages created by an addon? (Example-URL: moz-extension://285d678c-ecb3-4003-923d-835fc9d8e0bc/reader.html) I know how to change normal pages css via different tools like Stylus etc. (or via userContent.css). But this does not work for pages created by addons. Can you please help me?

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

I tested on one of my pages and this worked. I did use !important which sometimes is needed to override rules that are considered to have a higher CSS specificity:

@-moz-document url("moz-extension://5cfb8e4d-ab5d-48d2-ac71-8433ee9b62cd/logaddnew.html"){ html {background-color: #fed !important;} body {background-color: transparent !important;} table#CTLog {background-color: #ffc !important;} }

(Those are not recommended colors, just for testing.)

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

Tất cả các câu trả lời (6)

more options

You should go to the site where you got the useChrome.css content from and ask them.

Hữu ích?

more options

The userChrome.css holds style rules for modifying Firefox's user interface, right?

I am not trying to do that. I am trying to change the page itself. Normally this works via the userContent.css. But not in this case.

Is this a misunderstanding here?

Hữu ích?

more options

Note that your Firefox 88.0 version is outdated.

Verify that you meet the System Requirements (GTK+ and GLib) for the current Firefox release.


Is this a page that the extension opens in a tab or a page that opens in a pop-up? Did you check this in the Inspector?

You normally use @-moz-document url() or url-prefix(){}

Hữu ích?

more options

Thank you cor-el!

Yes, the extension opens this page in a tab.

And yes, I checked it with the Inspector ... and could edit and change the elements of the page just fine.

And in the /home/user/.mozilla/firefox/4fgfbksq.default/chrome/userContent.css I used:

@-moz-document domain(moz-extension://285d678c-ecb3-4003-923d-835fc9d8e0bc/reader.html) and also: @-moz-document url(moz-extension://285d678c-ecb3-4003-923d-835fc9d8e0bc/reader.html) and also: @-moz-document url-prefix(moz-extension://285d678c-ecb3-4003-923d-835fc9d8e0bc/reader.html)

... for instance followed by a simple:

{

   div#toolbar {
   background-color: #D09595;
   }

}


But in all 3 cases: No change of color. Am I missing something here?

Hữu ích?

more options

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

I tested on one of my pages and this worked. I did use !important which sometimes is needed to override rules that are considered to have a higher CSS specificity:

@-moz-document url("moz-extension://5cfb8e4d-ab5d-48d2-ac71-8433ee9b62cd/logaddnew.html"){ html {background-color: #fed !important;} body {background-color: transparent !important;} table#CTLog {background-color: #ffc !important;} }

(Those are not recommended colors, just for testing.)

Hữu ích?

more options

Halleluja!

Thank you guys so much! And especially you, jscher2000! It has indeed been the missing "!important"!

You guys are wonderful! ... and I have so much still to learn!

:-)

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

Hữu ích?

Đặt một câu hỏi

Bạn phải đăng nhập vào tài khoản của bạn để trả lời bài viết. Vui lòng bắt đầu một câu hỏi mới, nếu bạn chưa có tài khoản.