&decode
by
noromanba
2017-02-17 [2017/02/17 09:02:09]
stupid decoder of numeric-character/character-entity reference
-
/*
* @title &decode
* @description stupid decoder of numeric-character/character-entity reference
* @include http://*
* @include https://*
* @license MIT License http://opensource.org/licenses/MIT
* @javascript_url
*/
// e.g.
// http://s.hatena.ne.jp/entries.json?uri=http://let.hatelabo.jp/noromanba/let/gYC-x6_02LnWEg
(() => {
'use strict';
const letter = String(window.getSelection());
if (!letter) return;
const decoded = Object.assign(document.createElement('textarea'),
{ innerHTML: letter }
).value;
// You can copy to Ctrl/Command + C; w/o some Linux DE
window.alert(decoded);
})();
-
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。