如何使用@document规则将某些网站从应用规则中排除? [英] How to use @document rule to exclude certain sites from applying rules to?
问题描述
我想这样做,因此我的规则默认应用于除了我列出的网站/网页之外的所有网站/网页。
I want to make it so my rules apply by default to all the sites/pages except the ones I list.
类似 @document domain(mozilla.org)
https://developer.mozilla.org/en -US / docs / CSS / @ document
编辑:后续正则表达式
推荐答案
目前没有一种简单的方法,如此CSS条件规则草案
There isn't an easy way to do this currently, as noted in this CSS Conditional Rules draft with a link to a Mozilla bug report:
此语法不提供任何执行否定的功能, a href =https://bugzilla.mozilla.org/show_bug.cgi?id=349813 =nofollow> Mozilla错误349813 。用户想要否定的用例包括:
This syntax doesn't offer any ability to do negations, which has been requested in Mozilla bug 349813. Use cases that people have wanted negations for include:
-
一般需要特定规则的用户样式表,
User style sheets that want a particular rule in general, but know that that rule does more harm than good on specific sites.
拥有规则的作者希望应用于大多数网页,但希望制作一些例外。
Authors who have a rule that they want to apply to most of their pages, but wish to make a few exceptions for.
希望他们能尽快提出并实施此类功能。
Hopefully, they'll propose and implement such a feature soon.
同时,您可以使用 regexp()
来实现某些功能,它接受一个JavaScript正则表达式某些标志 - 细节包括在规格 - 但我不能作出任何保证。
In the meantime, you may be able to achieve something with regexp()
which accepts a JavaScript regex with certain flags — details are included in the spec — but I can't make any guarantees.
这篇关于如何使用@document规则将某些网站从应用规则中排除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!