display all bookmarks including no-comment @ Hatena::Bookmark

    @@ -1,5 +1,5 @@ /* - * @question:1521455576 + * @title question:1521455576 * @description question:1521455576 * @license MIT http://opensource.org/licenses/MIT * @javascript_url
  • /*
     * @title question:1521455576
     * @description question:1521455576
     * @license MIT http://opensource.org/licenses/MIT
     * @javascript_url
     */
    (function() {
    	const d_ = document;
    
    	Array.prototype.forEach.call(d_.body.querySelectorAll("script,style,noscript"), function(e) {
    		e.parentNode.removeChild(e);
    	});
    
    	const text = d_.body.textContent.replace(/\s+/g, "");
    	const count = text.length;
    	const title = d_.title;
    	const hx_list = d_.querySelectorAll("h1,h2,h3,h4,h5,h6");
    
    	const panel = d_.body.appendChild(d_.createElement("textarea"));
    	panel.style.position = "fixed";
    	panel.style.backgroundColor = "white";
    	panel.style.border = "1px solid black";
    	panel.style.padding = "1ex";
    	panel.style.top = "0";
    	panel.style.width = "80ex";
    	panel.style.height = "20em";
    	function indent(tag) {
    		let n = parseInt(tag.replace(/^H/, "")) - 1;
    		let pad = "";
    		for (let i = 0 ; i < n ; ++i) {
    			pad += "\t";
    		}
    		return pad;
    	}
    	panel.value = [
    		"【文字数】",
    		count,
    		"\n【title】",
    		title,
    		"\n【hタグ】",
    		Array.prototype.map.call(hx_list, function(h) {return indent(h.tagName) + h.tagName + ":" + h.textContent;}).join("\n"),
    	].join("\n");
    })();
    
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2018/03/23 08:30:53 - 2018-03-23
  2. 2018/03/19 23:37:26 - 2018-03-19
  3. 2018/03/19 23:37:06 - 2018-03-19
  4. 2017/09/11 16:49:36 - 2017-09-11
  5. 2017/09/09 01:57:19 - 2017-09-09
  6. 2017/09/08 23:25:01 - 2017-09-08
  7. 2017/09/08 13:35:17 - 2017-09-08