Twimedi

    @@ -7,6 +7,9 @@ * @javascript_url */ +// view all imgs +// http://let.hatelabo.jp/noromanba/let/hJmcyb717pBx + // via id:furyu-tei // http://let.hatelabo.jp/furyu-tei/let/hLHUyOKF-tI4 // http://let.hatelabo.jp/furyu-tei/let/hJmcyOHMtZQz @@ -25,13 +28,13 @@ return; } - // TODO priority to .Gallery-media on extended wall + // TODO priority to .Gallery-media on expanded lightbox wall const mediaURLs = Array.from(document.body.querySelectorAll([ '.expansion-container', '.AdaptiveMedia', - 'img[src]', // TBD other medias + 'img[src]', // TODO other medias ].join(' '))).filter(media => !!media.src).map(media => { - // TBD .jpg:SIZE check + // TBD .jpg:SIZE, .png:SIZE check return media.src + ':orig'; }); if (!mediaURLs.length) return; @@ -51,3 +54,4 @@ }); page.document.close(); })(); +
  • /*
     * @title Twimedi
     * @description open current tweet medias in new tab/window
     * @include *://twitter.com/*
     * @contributor furyu-tei http://let.hatelabo.jp/furyu-tei/let/hJmcx4_e4fIl (Fork of)
     * @license MIT License http://opensource.org/licenses/MIT
     * @javascript_url
     */
    
    // view all imgs
    // http://let.hatelabo.jp/noromanba/let/hJmcyb717pBx
    
    // via id:furyu-tei
    // http://let.hatelabo.jp/furyu-tei/let/hLHUyOKF-tI4
    // http://let.hatelabo.jp/furyu-tei/let/hJmcyOHMtZQz
    
    (() => {
        // needs statuses?
        // https://twitter.com/<SCREEN_NAME>/status/<TWEET_ID>
        if (!/twitter\.com/.test(location.hostname) ||
            //*/
            location.pathname.split('/').slice(1) < 3) { // TBD RegExp
            /*/
            // ES7 Array#includes c.f.
            // http://kangax.github.io/compat-table/es7/
            location.pathname.split('/').includes('status') {
            //*/
            return;
        }
    
        // TODO priority to .Gallery-media on expanded lightbox wall
        const mediaURLs = Array.from(document.body.querySelectorAll([
            '.expansion-container',
            '.AdaptiveMedia',
            'img[src]', // TODO other medias
        ].join(' '))).filter(media => !!media.src).map(media => {
            // TBD .jpg:SIZE, .png:SIZE check
            return media.src + ':orig';
        });
        if (!mediaURLs.length) return;
    
        // TODO strict DOM construction c.f.
        // http://let.hatelabo.jp/noromanba/let/hLHX5oTN2bUh
        const page = window.open('about:blank', '_blank');
        page.document.write('<head><title>' + document.title + '</title></head>');
        page.document.write('<body style="text-align:center; background-color:black;">');
        mediaURLs.forEach(url => {
            page.document.write([
                '<a href="' + url + '">',
                '<img src="' + url + '"',
                'style="max-width: 100%; max-height: 100%;">',
                '</a>',
            ].join(''));
        });
        page.document.close();
    })();
    
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2016/01/22 05:01:58 - 2016-01-22
  2. 2016/01/17 00:55:38 - 2016-01-17
  3. 2016/01/17 00:39:54 - 2016-01-17
  4. 2016/01/17 00:31:03 - 2016-01-17