Base64=

    @@ -11,8 +11,10 @@ // via // http://let.hatelabo.jp/pacochi/let/gYC-y4q0j9PCQQ -// c.f. +// Base64 c.f. // https://en.wikipedia.org/wiki/Base64 +// http://d.hatena.ne.jp/izariuo440/20110127/1296138201 +// https://wiki.suikawiki.org/n/base64url // e.g. // https://en.wikipedia.org/wiki/Base64#Examples @@ -36,6 +38,7 @@ const letter = window.getSelection().toString(); if (!letter) return; + // TBD trim, online const decoded = window.Base64.decode(letter); // You can copy to Ctrl/Command + C; w/o some Linux DE window.alert(decoded);
  • /*
     * @title Base64=
     * @description stupid decoder of various encoded Base64
     * @include http://*
     * @include https://*
     * @contributor dankogai     https://github.com/dankogai/js-base64
     * @license     BSD 3-clause https://github.com/dankogai/js-base64/blob/master/LICENSE.md
     * @javascript_url
     */
    
    // via
    // http://let.hatelabo.jp/pacochi/let/gYC-y4q0j9PCQQ
    
    // Base64 c.f.
    // https://en.wikipedia.org/wiki/Base64
    // http://d.hatena.ne.jp/izariuo440/20110127/1296138201
    // https://wiki.suikawiki.org/n/base64url
    
    // e.g.
    // https://en.wikipedia.org/wiki/Base64#Examples
    // same result/meaning when decoded per line
    // https://github.com/dankogai/js-base64/blob/master/README.md
    //    ZGFua29nYWk=
    //    5bCP6aO85by+
    //    // note .decodeURI() is unnecessary since it accepts both flavors
    //    5bCP6aO85by-
    (() => {
        'use strict';
    
        // TBD detect window.Base64 and avoid global conflicts
        const wall = document.head || document.body || document.documentElement;
        wall.appendChild(Object.assign(document.createElement('script'), {
            // smart Base64 codec c.f.
            // http://blog.livedoor.jp/dankogai/archives/51067688.html
            // https://github.com/dankogai/js-base64
            src: 'https://cdn.rawgit.com/dankogai/js-base64/master/base64.min.js'
        })).addEventListener('load', () => {
            const letter = window.getSelection().toString();
            if (!letter) return;
    
            // TBD trim, online
            const decoded = window.Base64.decode(letter);
            // You can copy to Ctrl/Command + C; w/o some Linux DE
            window.alert(decoded);
        });
    })();
    
    // numeric-character/character-entity reference c.f.
    // http://let.hatelabo.jp/noromanba/let/hLHWyYel3vpW
    
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2017/04/11 01:03:30 - 2017-04-11
  2. 2017/04/10 23:56:38 - 2017-04-10
  3. 2017/04/10 23:55:18 - 2017-04-10
  4. 2017/04/10 11:50:27 - 2017-04-10