ページ内の画像一覧(サムネはリンク先に差し替えて表示)

  • /*
     * @title ページ内の画像一覧(サムネはリンク先に差し替えて表示)
     * @include http://*
     * @license MIT License
     * @require 
     */
    
    (function(images) {
      d = window.open().document;
      for (i = 0; i < images.length; ++i) {
        x = is[i];
        if (x.height < 100) continue; // なんとなくアイコン類を除外
        var link = ((p = x.parentElement) && ('' + p.href).match(/(jpg|png|gif)$/i)) ? p.href : x.src;
        d.write(`<a target="_blank" href="${link}"><img style="max-width:100%" src="${link}"></a> `)
      }
    })(document.getElementsByTagName('img'))
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2017/02/01 20:23:41 - 2017-02-01