Add CSS easily.

  • /*
     * @title Add CSS easily.
     * @description 今見ているサイトに、手軽にCSSを追加するブックマークレットです。おもに制作・デバッグ用です。
     * @license MIT License
     * @require 
     */
    
    (function(t,b,s,c){if(!window.addCss){window.addCss={};}if(!window.addCss.cnt){window.addCss.css=document.createElement('style');window.addCss.css.type='text/css';document.getElementsByTagName('head')[0].appendChild(window.addCss.css);window.addCss.cnt=document.styleSheets.length-1;}t=document.createElement('textarea');t.setAttribute('style',['width:300px','height:80px','position:fixed','right:0','top:10px','z-index:1000'].join(';'));b=document.createElement('input');b.type='button';b.value='Add';b.setAttribute('style',['position:fixed','right:15px','top:95px','z-index:1000'].join(';'));b.onclick=function(){window.addCss.css.appendChild(document.createTextNode(t.value));document.body.removeChild(t);document.body.removeChild(b);};document.body.appendChild(t);document.body.appendChild(b);})();
    
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2010/08/11 23:41:46 - 2010-08-11