Greasy Fork

Greasy Fork is available in English.

祭奠百度

或许未来只有一片精致的灰 !

当前为 2020-07-30 提交的版本,查看 最新版本

(function () {
  // ASSET: /home/llej/code/userJS/祭奠百度/祭奠百度.user.ts
  // ==UserScript==
  // @name         祭奠百度
  // @namespace    http://tampermonkey.net/
  // @version      1.39
  // @description  或许未来只有一片精致的灰 !
  // @author       崮生 [email protected]
  // @match        *
  // @include      *
  // @connect      shenzilong.cn
  // @grant        GM.setValue
  // @grant        GM.getValue
  // ==/UserScript==
  (() => {
    function main() {
      const style_el = document.createElement("style");
      const gray = `-webkit-filter: grayscale(100%);
    -moz-filter: grayscale(100%);
    -ms-filter: grayscale(100%);
    -o-filter: grayscale(100%);
    filter: grayscale(100%);
    filter: gray;`;
      style_el.innerHTML = `
      ${pan_contained([
      /** 百度 */
      "baidu",
      /** 百度静态资源 */
      "bdstatic",
      /**  */
      "bdimg"])},
      /** https://pan.baidu.com/buy/checkoutcounter?from=non&vip=1 */
      .cashier-page-logo
      {${gray}}
      `;

      function pan_contained(selector) {
        return selector.map(s => `[src*=${s}],
            [style*=${s}]`).join(",");
      }

      document.body.insertBefore(style_el, document.querySelector("body *"));
    }

    main();
  })();
})();