代码之家  ›  专栏  ›  技术社区  ›  fferri

较暗的Google用户脚本在4.7中不起作用

  •  -2
  • fferri  · 技术社区  · 6 年前

    Darker Google Tampermonkey 4.7中的用户脚本(用于Safari 12),但它不起作用。

    因为我是一个完全的新手,我真的不知道该把我的手放在哪里。

    在Tampermonkey的仪表板中,我看到这个用户脚本与任何特定网站都不匹配,例如 Darker Facebook 显示“*.facebook.com”并运行,但这可能只是一个错误的猜测。

    (function() {var css = "";
    css += [
            "/* Darker Google by Zigboom Designs */",
            "",
            "@namespace url(http://www.w3.org/1999/xhtml);"
        ].join("\n");
    if (false ||
        (document.location.href.indexOf("http://blogsearch.google") == 0) ||
        (document.location.href.indexOf("http://books.google") == 0) ||
        (document.location.href.indexOf("http://209.85.165.104") == 0) ||
        (document.location.href.indexOf("http://translate.google") == 0) ||
        (document.location.href.indexOf("http://video.google") == 0) ||
        (document.location.href.indexOf("https://encrypted.google") == 0) ||
        (document.location.href.indexOf("https://translate.google") == 0) ||
        (document.location.href.indexOf("http://scholar.google") == 0) ||
        (document.location.href.indexOf("https://scholar.google") == 0) ||
        (document.location.href.indexOf("http://images.google") == 0) ||
        (document.location.href.indexOf("https://images.google") == 0) ||
        (document.location.href.indexOf("https://www.google.com/fonts") == 0) ||
        (new RegExp("^https?://www\\.google\\.[a-z.]*/(?!calendar|nexus|adsense|analytics|maps).*$")).test(document.location.href))
    

    所以我觉得 应该

    1 回复  |  直到 6 年前
        1
  •  0
  •   Vignesh Raja    6 年前

    // @match *://*.google.com/*

    以上内容使得userscript可以在Google网站上运行。

    对于匹配模式, refer here