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

Tìm hiểu thêm

url filter doesn't work in userContent.css

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

more options

Linux x86_64, Firefox 28

In my userContent.css I have:

@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document domain(www.utro.ru)
{
  * {
    font-family: "Arial" !important;
    font-size:   10px !important;
    }
}


  * {
    font-family: "Verdana" !important;
    font-size:   15px    !important;
    line-height: 1.3em   !important;
  }
  h1, h2, h3, h4, h5, h6 {
    font-family: Verdana !important;
    font-size: 13px !important;
    font-weight: bold !important;
  }

What I expected is to see "www.utro.ru" with Arial font and 10 px size Other pages - with Verdana font and 15px size. But in reality Firefox draws every page with Verdana 15px.


If I remove every other conditions:

@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document domain(www.utro.ru)
{
  * {
    font-family: "Arial" !important;
    font-size:   10px !important;
    }
}

Firefox starts to draw is expected - Arial 10px. Other pages with default font from configuration.

Is it another bug or I did something wrong? Firefox ignores more then one url filter condition!

Linux x86_64, Firefox 28 In my userContent.css I have: <pre><nowiki>@namespace url(http://www.w3.org/1999/xhtml); @-moz-document domain(www.utro.ru) { * { font-family: "Arial" !important; font-size: 10px !important; } } * { font-family: "Verdana" !important; font-size: 15px !important; line-height: 1.3em !important; } h1, h2, h3, h4, h5, h6 { font-family: Verdana !important; font-size: 13px !important; font-weight: bold !important; }</nowiki></pre> What I expected is to see "www.utro.ru" with Arial font and 10 px size Other pages - with Verdana font and 15px size. But in reality Firefox draws every page with Verdana 15px. If I remove every other conditions: <pre><nowiki>@namespace url(http://www.w3.org/1999/xhtml); @-moz-document domain(www.utro.ru) { * { font-family: "Arial" !important; font-size: 10px !important; } }</nowiki></pre> Firefox starts to draw is expected - Arial 10px. Other pages with default font from configuration. Is it another bug or I did something wrong? Firefox ignores more then one url filter condition!

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

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

nimnull22 wrote:

Thank you. Your solution works as expected.

You're welcome.

nimnull22 wrote:

How to exclude one site.

Here's an example of a global style with an exception. Just replace the placeholders with actual domain names. Add another | symbol followed by the domain name to add another exception.


@-moz-document regexp("https?://(?!(utro.ru|example-of-an-exception.com|www.placeholder.site-exception.net)).*") {

/* The following is for all sites except Utro.ru */
* { font-family: "Comic Sans MS" !important; }

}

/* The following is just for support.mozilla.org
It will override the global declaration above */
@-moz-document domain("support.mozilla.org") {

* { font-family: "Times New Roman" !important; }

}

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

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

more options

OK.

Everything works except for one problem.

I need one domain uses its own font and font-size.

How to exclude one site. For example I need it to uses Verdana for sans-serif and Courier New for monospace?

more options

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

nimnull22 wrote:

Thank you. Your solution works as expected.

You're welcome.

nimnull22 wrote:

How to exclude one site.

Here's an example of a global style with an exception. Just replace the placeholders with actual domain names. Add another | symbol followed by the domain name to add another exception.


@-moz-document regexp("https?://(?!(utro.ru|example-of-an-exception.com|www.placeholder.site-exception.net)).*") {

/* The following is for all sites except Utro.ru */
* { font-family: "Comic Sans MS" !important; }

}

/* The following is just for support.mozilla.org
It will override the global declaration above */
@-moz-document domain("support.mozilla.org") {

* { font-family: "Times New Roman" !important; }

}

more options

@ Gingerbread Man

Thanks a lot for your examples. Now all works as I expected.

  1. 1
  2. 2