Pitchfork Score Reveal

    
      
  • /*
     * @title pitchfork score
     * @description Pitchfork でぼかされているスコアを表示する
     * @include https://pitchfork.com/reviews/albums/*
     * @license MIT License
     * @require 
     */
    
    javascript: (() => {
      const s =
        window.__PRELOADED_STATE__?.transformed?.review?.headerProps?.musicRating
          ?.score;
      if (s === undefined || s === null || s === "") {
        alert("Pitchfork のレビューページじゃないか、データ構造が変わってるじゃん");
        return;
      }
      const p = document.querySelector(
        '[class*="SplitScreenContentHeaderScoreBox"] p',
      );
      if (!p) {
        alert(
          "スコア: " + s + "(DOM に挿入できんかった。セレクタを更新する必要あり)",
        );
        return;
      }
      p.textContent = String(s);
      let el = p;
      while (el) {
        const f = getComputedStyle(el).filter;
        if (f && f.includes("blur")) {
          el.style.filter = "none";
        }
        el = el.parentElement;
      }
    })();
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。