getHTMLsource
by
sin5
2010-06-25 [2010/06/25 22:49:28]
選択した範囲のHTMLのソースを整形して表示してくれるWEBサービスに飛ばします。
@@ -6,5 +6,9 @@
* @require
* @private
*/
-d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().htmlText:0)),alert(s),alert('test')
+con = document.getSelection().getRangeAt(0).cloneContents;
+div = document.createElement('div');
+document.body.appendChild(div);
+div.appendChild(con);
+alert(d.innerHTML);
/*
* @title bookmarklet
* @description my bookmarklet
* @include http://*
* @license MIT License
* @require
* @private
*/
con = document.getSelection().getRangeAt(0).cloneContents;
div = document.createElement('div');
document.body.appendChild(div);
div.appendChild(con);
alert(d.innerHTML);
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。