クッキー簡易表示

  • /*
     * @title クッキー簡易表示
     * @description クッキーをデコードしつつ別窓 (別タブ) で表示します。
     * @include http://*
     * @license MIT License
     * @require 
     */
    
    (function() {
    
    var c = document.cookie.split(';');
    var w = window.open('', '');
    var wd = w.document;
    wd.open();
    wd.close();
    wd.title = "cookie:" + document.title;
    while (c.length) wd.body.appendChild(wd.createElement('p').appendChild(wd.createTextNode(decodeURIComponent(c.shift()))).parentNode);
    
    /*
    while (c.length) {
    
    	var p = wd.createElement('p');
    	p.appendChild(wd.createTextNode(decodeURIComponent(c.shift())));
    	wd.body.appendChild(p);
    
    }
    */
    
    })();
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2010/07/02 16:36:24 - 2010-07-02