t.um block

    @@ -10,7 +10,11 @@ // https://gist.github.com/noromanba/76a3d7791cf6eaf1c94c // c.f. +// http://ptech.g.hatena.ne.jp/noromanba/20160208/1454965267 // https://stackoverflow.com/questions/35023389/tumblr-injecting-new-code-into-my-links + +// e.g. +// http://yahoo.tumblr.com/post/138290069904/yahoo-sports-launches-the-vertical (() => { 'use strict';
  • /*
     * @title t.um block
     * @description detox t.umbler.com link on tumblr.com
     * @include *://*.tumblr.com/*
     * @license CC0 Univ PD https://creativecommons.org/publicdomain/zero/1.0/legalcode
     * @javascript_url
     */
    
    // UserScript
    // https://gist.github.com/noromanba/76a3d7791cf6eaf1c94c
    
    // c.f.
    // http://ptech.g.hatena.ne.jp/noromanba/20160208/1454965267
    // https://stackoverflow.com/questions/35023389/tumblr-injecting-new-code-into-my-links
    
    // e.g.
    // http://yahoo.tumblr.com/post/138290069904/yahoo-sports-launches-the-vertical
    (() => {
      'use strict';
    
      const detox = (ctx) => {
          if (!ctx.querySelectorAll) return;
    
          Array.from(ctx.querySelectorAll([
              '[href^="http://t.umblr.com/redirect?z="]',
              '[src^="http://t.umblr.com/redirect?z="]'
          ]), link => {
              // redirector syntax;
              // http://t.umblr.com/redirect?z=<ENCODED_URL>&t=<72_DIGIT_HASH>
              let url = decodeURIComponent(new URL(link.href).search.slice(3));
              url = url.split('&');
              url.pop(); // delete "t=<72_DIGIT_HASH>"
    
              link.href = url.join('&');
          });
      };
      detox(document.body);
    
      new MutationObserver(records => {
          records.forEach(record => {
              detox(record.target);
          });
      }).observe(document.body, { childList: true, subtree: true });
    })();
    
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2016/02/12 05:20:12 - 2016-02-12
  2. 2016/02/12 05:00:14 - 2016-02-12
  3. 2016/02/12 04:58:48 - 2016-02-12
  4. 2016/02/10 07:14:20 - 2016-02-10
  5. 2016/02/09 07:07:47 - 2016-02-09
  6. 2016/02/09 06:58:31 - 2016-02-09
  7. 2016/02/09 06:16:43 - 2016-02-09
  8. 2016/02/09 04:56:04 - 2016-02-09
  9. 2016/02/09 04:55:05 - 2016-02-09
  10. 2016/02/09 04:42:41 - 2016-02-09