Wizball の詳細ページで質問投稿日時を表示する

    
      
  • /*
     * @title Wizball の詳細ページで質問投稿日時を表示する
     * @description Wizball の詳細ページで質問投稿日時を表示する
     * @include https://wizball.io/questions/*
     * @license MIT License http://opensource.org/licenses/MIT
     * @javascript_url *
     */
    
    (_ => {
        if (location.hostname != "wizball.io" || ! /^\/questions\/\d+/.test(location.pathname)) {
            return;
        }
        const m = /^\/questions\/(\d+)/.exec(location.pathname);
        if (m) {
            fetch("/apis/v1/questions/" + m[1])
            .then(resp => resp.json())
            .then(json => {
                const d = new Date(json.createdAt);
                const e = document.querySelector(".profile_info_area > .date");
                e.innerHTML = d.toLocaleString();
            });
        }
    })();
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2018/10/30 13:02:47 - 2018-10-30