在 Firefox 中的某些站点上禁用时尚

rus*_*ush 8 firefox firefox-extensions

我在 Firefox 中使用深色主题,但有时我会访问一些不需要此类主题的网站。我想以原始风格看到它们。

我找到了启用每个站点特定功能的方法:

@-moz-document domain("google.com")
Run Code Online (Sandbox Code Playgroud)

有没有办法只为某些域禁用时尚,而无需烦人的鼠标点击来禁用所有 aites 的整个时尚并在之后再次启用它?

Wla*_*ant 4

并不像人们想象的那么容易。目前相关bug尚未修复您可以使用regexp()条件(自 Firefox 6 起可用)达到相同的效果,但所需的正则表达式相当难看。例如,要排除google.com域,您可以编写:

@-moz-document regexp("https?://(?!([^.]+\\.)?google\\.com[/:]).*")
Run Code Online (Sandbox Code Playgroud)

如果您需要指定多个域,则必须这样做:

@-moz-document regexp("https?://(?!([^.]+\\.)?(google\\.com|example\\.com|foo\\.bar)[/:]).*")
Run Code Online (Sandbox Code Playgroud)