ãã¼ã¸ã®æå¾ã§ã¹ã¯ãã¼ã«ãããã¨ãããèªåã§éãã
ããã§ã
- Google Readerããvãã¼ã§å ãã¼ã¸ã表示
- ã¹ãã¼ã¹ãã¼ã§èªã¿é²ã
- ãã¼ã¸ã®æå¾ã¾ã§è¡¨ç¤ºãããéãã
ã¨ããä¸é£ã®æä½ãã¹ã ã¼ãºã«ã§ããã
âインストールする
(2006.10.14 Altãã¼ã®ãã§ãã¯ã追å )
// ==UserScript== // @name CloseAtPageEnd // @namespace http://d.hatena.ne.jp/nozom/ // @include * // @description Add autoclosing at the end of page // ==/UserScript== // Released under the GPL license // http://www.gnu.org/copyleft/gpl.html (function() { function get_remain() { var canvas = document[ document.compatMode == 'CSS1Compat' ? 'documentElement' : 'body']; // GM_log('scrollHeight = ' + canvas.scrollHeight); // GM_log('clientHeight = ' + canvas.clientHeight); // GM_log('scrollTop = ' + canvas.scrollTop); // GM_log('pageYOffset = ' + window.pageYOffset); var total = canvas.scrollHeight - canvas.clientHeight; return total - window.pageYOffset; } function close_window() { window.opener = window; var win = window.open(location.href, "_self"); win.close(); } function forward_page() { var remain = get_remain(); // GM_log('remain = ' + remain); if (remain == 0) { if (confirm('Close?')) { close_window(); } } } function GRT_key(event) { var element = event.target; var elementName = element.nodeName.toLowerCase(); if ((elementName == "input") || (elementName == "textarea")) { return true; } if (String.fromCharCode(event.which) == " " && !event.ctrlKey && !event.altKey) { forward_page(); return false; } return true; } function GRT_wheel(event) { var delta = event.detail; if (delta > 0) { forward_page(); } } if (window.parent == window.self) { document.addEventListener("keypress", GRT_key, false); // document.addEventListener("DOMMouseScroll", GRT_wheel, false); } })();
åèãµã¤ã
- 大æ¬ã«ããã¹ã¯ãªããï¼ã»ã¨ãã©åå½¢ãçãã¦ãªããã©ï¼
- ãã¦ã¹ãã¤ã¼ã«ã¤ãã³ããæ±ãæ¹æ³
- ã¹ã¯ãã¼ã«éãåå¾ããæ¹æ³
- Javascriptããä»»æã®ã¦ã£ã³ãã¦ãéããæ¹æ³