Firefoxã§ã®JavaScriptãããã°ãã¯ç
obj.watch("prop", function (id, older, newer) { console.log(id, older, newer, arguments.callee.caller); return newer; });
obj.prop
ã«å¤ã代å
¥ãã¦ãé¢æ°ã調ã¹ããã¯ããã¯ã®ç´¹ä»ã
ä¸ã®ã¹ã¯ãªããã¯FC2Blogã§ã¯ã¦ãªè¨æ³ã使ããããã«ããï¼ãããã°åã®åããªãï¼ã¹ã¯ãªããã§ãtext-hatena.jsã«ã¤ãã¦ã¯é·ãããããã«è¼ããã¨ãã«åã£ãã
// ==UserScript== // @name FC2 Hatenation // @namespace http://oksoftware.blog52.fc2.com/ // @description Use Hatena syntax in FC2 Blog // @include http://blog*.fc2.com/* // ==/UserScript== /* Following codes are based text-hatena.js version 0.5 */ // çç¥ /* text-hatena.js end */ /* from here on original code */ window.attachEvent("onload", function() { var input_elem = document.getElementByTagName("input"); for(var i = 0; i < input_elem.length; i++){ if(input_elem.getAttribute("onClick").match(/^postEntry/)){ input_elem.onclick = function(){ var textarea_elem = document.getElementById("body"); var src = textarea_elem.value.replace(/^.*<!-- FC2 HATENATION (.*) END FC2 HATENATION -->.*$/, "$2"); var hatena = new Hatena({sectionanchor : "「」"}); hantena.parse(String._unescapeHTML(src)); textarea_elem.value = hatena.html(); postEntry(); return false; }; } } });
[10/01/31 0:45:04] oksoftware: http://files.oksoftware.info/fc2_hatenation.user.js [10/01/31 0:45:06] oksoftware: ãã㤠[10/01/31 0:45:15] oksoftware: 799è¡ç®ã«}ããªãã¨ã [10/01/31 0:45:17] oksoftware: æããããã§ããã© [10/01/31 0:45:24] oksoftware: ãã£ã±ãä½ãããããã ããããªã㦠[10/01/31 0:45:32] oksoftware: å¤ååãJSã®ææ³ãç解ãã¦ããªãã®ãåå ãªã®ã§ [10/01/31 0:45:33] ã¤ã£ãã(javascripter): Firefoxç¨ï¼ [10/01/31 0:45:34] oksoftware: æ·»åãã¦ãã ãã [10/01/31 0:45:48] oksoftware: Operaã§ãFirefoxã§ãåãã®ãç®æãã¦ããããããæ©è½ã¯ä½¿ã£ã¦ãªã [10/01/31 0:46:41] ã¤ã£ãã(javascripter): syntax errorã¯ãã¶ããªã [10/01/31 0:46:55] oksoftware: ã¾ããã [10/01/31 0:47:04] oksoftware: Opera Syntax Erroråããããã»ã»ã» [10/01/31 0:47:11] ã¤ã£ãã(javascripter): Safariã®consoleã§è©ä¾¡ãããå¹³æ°ã ã£ãã [10/01/31 0:47:13] oksoftware: Firefoxã§ã¯åããªã [10/01/31 0:47:20] oksoftware: ãã¼ã¼ã¼ã¼ã [10/01/31 0:47:44] ã¤ã£ãã(javascripter): ã¡ããã¾ã¡ [10/01/31 0:47:47] oksoftware: ã¯ã [10/01/31 0:48:31] ã¤ã£ãã(javascripter): Firebug㧠[10/01/31 0:48:39] ã¤ã£ãã(javascripter): warningsãå«ãã¦ã¨ã©ã¼ã表示ããããã«ã㦠[10/01/31 0:48:47] ã¤ã£ãã(javascripter): about:configã¨ãã§javascript.strict?çãªãã¤ã [10/01/31 0:48:55] ã¤ã£ãã(javascripter): ãªã³ã«ãã [10/01/31 0:50:09] oksoftware: ã¯ãã»ã»ã» [10/01/31 0:53:53] ã¤ã£ãã(javascripter): ã¾ãæåã«è¨ããã®ã¯ [10/01/31 0:53:58] oksoftware: ã¯ã [10/01/31 0:53:59] ã¤ã£ãã(javascripter): postEntry()ã¯Firefoxã§ã¯åããªã㪠[10/01/31 0:54:17] ã¤ã£ãã(javascripter): postEntry()ã location.href = "javascript:void postEntry()"; [10/01/31 0:54:20] ã¤ã£ãã(javascripter): ã¨ãã«ããã¾ããã [10/01/31 0:54:24] oksoftware: ã¯ã [10/01/31 0:55:08] ã¤ã£ãã(javascripter): ãããã [10/01/31 0:55:11] ã¤ã£ãã(javascripter): input_elemã ãã© [10/01/31 0:55:14] ã¤ã£ãã(javascripter): ããã¯NodeListã§ãã£ã¦ [10/01/31 0:55:18] ã¤ã£ãã(javascripter): input_elem[i]ã¨ãããªã㨠[10/01/31 0:55:26] ã¤ã£ãã(javascripter): .onclickã®ã¨ã [10/01/31 0:55:32] ã¤ã£ãã(javascripter): getattributeã¨ãã [10/01/31 0:55:35] oksoftware: é ·ããã¹ã [10/01/31 0:55:38] oksoftware: æ·»åãããã¦ã [10/01/31 0:56:29] ã¤ã£ãã(javascripter): ãã¨"$2"ã£ã¦ [10/01/31 0:56:33] ã¤ã£ãã(javascripter): $1ãããï¼ [10/01/31 0:56:57] ã¤ã£ãã(javascripter): ã¡ããããª.*ã«ãã£ãã¤ããããã¦ãã®ããã㯠[10/01/31 0:57:29] ã¤ã£ãã(javascripter): ãã§ãã¨ã¯ [10/01/31 0:57:34] ã¤ã£ãã(javascripter): æåã³ã¼ããUTF-8ã«ãã¦ããã©ãã [10/01/31 0:57:44] ã¤ã£ãã(javascripter): ãããç´æ¥åãè¾¼ãã§ããã [10/01/31 0:57:46] oksoftware: FC2ã«ãããã¦euc-jpã«ãã¦ã [10/01/31 0:58:35] rosylilly: Operaã¨ãã£ã¦user.jsãUTF-8åæã§èªã¿è¾¼ãã§ãªãã£ãããã [10/01/31 0:59:14] ã¤ã£ãã(javascripter): ãããããã¨ã¯ [10/01/31 0:59:22] ã¤ã£ãã(javascripter): userscriptãèªã¿è¾¼ã¾ããã¿ã¤ãã³ã°ã¯DOMæ§ç¯å¾ãªã®ã§ [10/01/31 0:59:30] ã¤ã£ãã(javascripter): ãã¶ãattachEventãããªãããããããã£ã¦ããã®ã¨ [10/01/31 0:59:48] ã¤ã£ãã(javascripter): ã©ãã ãfc2è¦ã¦ããããå®éã®ã¨ãããããããã© [10/01/31 1:00:05] oksoftware: ããã£Operaã§tokenize erroråºãã®ã¯ããã ãª>UTF-8 [10/01/31 1:00:22] oksoftware: ãããªæ°ããã [10/01/31 1:09:03] ã¤ã£ãã(javascripter): ãã§onclickã¯Firefoxã§ããããªã [10/01/31 1:09:24] ã¤ã£ãã(javascripter): textarea_elemã [10/01/31 1:09:54] ã¤ã£ãã(javascripter): onclickæ¯ã«åå¾ããå¿ è¦ãããã®ããå¾®å¦ã§ [10/01/31 1:10:21] oksoftware: ãã®ãã¿ã³ã¯ä¿åãã¿ã³ã§ãã¦ãã»ã»ã» [10/01/31 1:10:29] oksoftware: 1ãã¼ã¸ã«3ã¤ä¿åãã¿ã³ããããã¾ããã [10/01/31 1:12:56] ã¤ã£ãã(javascripter): ã¾ããã¦ãæãã«ãã㨠[10/01/31 1:12:57] ã¤ã£ãã(javascripter): var textarea = document.getElementById("body"); [].forEach.call(document.querySelectorAll('input[onclick*="postEntry"]'), function (input) { input.addEventListener("click", function (e) { var src = textarea.value.replace(/^.*<!-- FC2 HATENATION (.*) END FC2 HATENATION -->(.*$)/, "$2"); var h = new Hatena({sectionanchor: "ãã"}); h.parse(String._unescapeHTML(src)); textarea.value = h.html(); location.href = "javascript:void postEntry()"; e.preventDefault(); }, false); }); [10/01/31 1:13:05] ã¤ã£ãã(javascripter): ãã¶ããããªãããã ã¨ãããã¾ããã© [10/01/31 1:13:13] ã¤ã£ãã(javascripter): ãã¦ãã¯å¿ è¦ãªãã§ããã¾ãã¯syntax errorã [10/01/31 1:13:25] oksoftware: ãã¦ã [10/01/31 1:13:35] oksoftware: ã¯ãã¼ã¸ã£ä½¿ã£ãã ãã§ãã¦æ°åã«ãªã£ã¦ã俺ã¨ã¯å¤§éãã [10/01/31 1:13:44] oksoftware: ã¦ã [10/01/31 1:13:53] ã¤ã£ãã(javascripter): attachEventã¨ãFirefoxã«ã¯ããã¾ããã [10/01/31 1:14:11] ã¤ã£ãã(javascripter): onclickã«ä»£å ¥ããã®ã¯ã°ãªã¢ã³ãSandboxåãããã³ã³ããã¹ãã§å®è¡ããã¦ãããã§ãã¾ããããªã㦠[10/01/31 1:14:20] ã¤ã£ãã(javascripter): addEventListenerã使ãã¾ããã [10/01/31 1:14:37] oksoftware: ã¨ãã㧠[10/01/31 1:14:39] ã¤ã£ãã(javascripter): ã¯ã [10/01/31 1:14:50] oksoftware: GetElementsByTagNameã GetElementByTagName㨠[10/01/31 1:14:52] oksoftware: æ¸ãã¦ããäºã§ [10/01/31 1:14:56] oksoftware: ãããã¦ããªãã£ãã¨ããäºã« [10/01/31 1:14:57] oksoftware: ãã¥ãã [10/01/31 1:15:10] ã¤ã£ãã(javascripter): ãã}ãã©ãã¨ã㯠[10/01/31 1:15:12] ã¤ã£ãã(javascripter): ã©ããªã£ãã® [10/01/31 1:15:15] oksoftware: ããããããã¹ã ããã éã [10/01/31 1:15:19] oksoftware: ãããã¾ã åãã«è³ã£ã¦ãªã [10/01/31 1:15:19] oksoftware: ãã¹ã®å±± [10/01/31 1:15:29] oksoftware: ãªãã§ä¿ºãããªçããã³ã¼ãã§ãããªã«ãã¹ä½ã£ã¦ãã [10/01/31 1:15:33] oksoftware: å¯ãªããæ¸ããããããªãã®ã [10/01/31 1:15:36] oksoftware: ã¾ãå¯ãªããæ¸ãããã§ããã©ã [10/01/31 1:15:45] ã¤ã£ãã(javascripter): ãªããè´å½çã«ééã£ã¦ã¦ã»ã¨ãã©åããªãæãã§ç¬ãã¾ãã [10/01/31 1:16:03] oksoftware: ããã¾ã§åããã³ã¼ãæ¸ããã®ãåãã¦ã㧠[10/01/31 1:18:20] oksoftware: i = 0ã®èã«varã¨ãæ¸ãããã㧠[10/01/31 1:18:26] oksoftware: ã«ã¼ããã1åããèµ°ã£ã¦ãªã [10/01/31 1:18:30] oksoftware: ãªãã ãã®ãã¹ã®å±± [10/01/31 1:18:31] oksoftware: ããã [10/01/31 1:18:36] oksoftware: ããæå³ã§å¤©æãæ¸ããã¨ãã [10/01/31 1:18:38] oksoftware: æããªã [10/01/31 1:20:10] oksoftware: ãããããã§ã¯ãªãã®ã [10/01/31 1:20:13] oksoftware: ãã£ãã¼ã¼ã¼ã¼ [10/01/31 1:20:38] ã¤ã£ãã(javascripter): åºã¦ãã¨ã©ã¼ãã®ã¾ã¾ã³ããã㦠[10/01/31 1:26:44] oksoftware: Component is not availableã£ã¦ãªãã [10/01/31 1:26:51] ã¤ã£ãã(javascripter): Firefox? [10/01/31 1:26:55] oksoftware: ããã [10/01/31 1:27:04] ã¤ã£ãã(javascripter): ã¾ããã ã®alertã¨ãã ãã®ã³ã¼ããæ¸ã㦠[10/01/31 1:27:06] ã¤ã£ãã(javascripter): åããç¢ºèª [10/01/31 1:27:12] oksoftware: ããã¯åã [10/01/31 1:27:36] ã¤ã£ãã(javascripter): çºçæºã¯ã©ã [10/01/31 1:27:44] ã¤ã£ãã(javascripter): nsSessionStore.jsã¨ãã ã£ãã [10/01/31 1:27:47] ã¤ã£ãã(javascripter): å¥ã«ãã«ããã§ããã [10/01/31 1:27:48] oksoftware: ãããããããäºã [10/01/31 1:27:52] oksoftware: addEventListenerã使ãã¾ãããã£ã¦ [10/01/31 1:27:58] oksoftware: ãã¼JSè¦æã [10/01/31 1:28:03] oksoftware: ã¾ã1ã¤å«ããªç©ãå¢ãã [10/01/31 1:29:25] ã¤ã£ãã(javascripter): 第ä¸å¼æ°ã¯attachEventã¿ãããããã£ããfalseã§ãããã ã [10/01/31 1:30:20] oksoftware: addEventListenerã£ã¦æ¢åã®onclickã殺ãããããã®ï¼ [10/01/31 1:30:35] ã¤ã£ãã(javascripter): ããã¯ã§ããã㪠[10/01/31 1:30:45] oksoftware: ãããããããèãçã [10/01/31 1:30:50] ã¤ã£ãã(javascripter): ãããã©ãããã£ã㪠[10/01/31 1:31:20] ã¤ã£ãã(javascripter): removeAttribute("onclick")ã§ãk [10/01/31 1:31:28] oksoftware: ãããã¨ãï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ [10/01/31 1:33:43] rosylilly: ç´ æµãªæ [10/01/31 1:35:17] oksoftware: removeAttributeã¯"onclick"ã§addEventListenerã¯click? [10/01/31 1:35:24] ã¤ã£ãã(javascripter): y [10/01/31 1:54:12] oksoftware: ããããã [10/01/31 1:54:14] oksoftware: FC2ã¦ã¶ã [10/01/31 1:54:35] oksoftware: ã¹ã¯ãªãããå¥æªã«å ¥ãçµãã§ã㦠[10/01/31 1:54:42] oksoftware: æµãã追ããªã [10/01/31 1:54:55] oksoftware: ãªããtextareaã®valueæ¸ãæãã㨠[10/01/31 1:54:56] oksoftware: æ»ããã [10/01/31 1:54:57] oksoftware: ãªãã ãã [10/01/31 1:55:12] rosylilly: firebugã§stepå®è¡ã§ããããï¼ [10/01/31 1:55:31] ã¤ã£ãã(javascripter): ä½ããã®ã¿ã¤ãã³ã°ã§setintervalã§textarea.valueã«ä»£å ¥ãã¦ãå¯è½æ§ããã [10/01/31 1:56:21] oksoftware: setIntervalã§grepãã¦ãåºã¦ã¯ããªãã£ããã [10/01/31 1:56:27] oksoftware: ã¤ãã³ãããªã [10/01/31 1:57:02] ã¤ã£ãã(javascripter): Firefoxã®Firebugã¨ã㧠textarea.watch("value", function (id, older, newer) { console.log(id, older, newer, arguments.callee.caller); return newer; }); [10/01/31 1:58:30] ã¤ã£ãã(javascripter): ãã§firebugã§ä¸ã®ãå®è¡ã㦠[10/01/31 1:58:43] ã¤ã£ãã(javascripter): textareano [10/01/31 1:58:47] ã¤ã£ãã(javascripter): valueãæ¸ãæãããã㦠[10/01/31 1:58:59] oksoftware: ã¿ã¤ãã£ãã¼ã¼ã¼ã¼ã¼ã£ [10/01/31 1:59:02] oksoftware: ã¤ã£ããç¥ã ã㸠[10/01/31 2:00:42] oksoftware: function updateField() { 381 area.value = mirror.getCode(); 382 } [10/01/31 2:02:04] oksoftware: ãã®ã¤ãã³ãã [10/01/31 2:02:11] oksoftware: ç´åã«æ®ºãã¦ããæ¸ãã°ããã®ã㪠[10/01/31 2:02:18] oksoftware: ãããã®å¾ã«ã¯éä¿¡ãããªããã殺ãã¦ãå®å®³ãªãã [10/01/31 2:02:41] ã¤ã£ãã(javascripter): ã«ããããããã¯éä¿¡formãèªä½ãxmlhttprequestã§ç´æ¥éãã¨ã [10/01/31 2:03:00] ã¤ã£ãã(javascripter): ããããmirror.getCodeãæ¸ãæããã [10/01/31 2:04:11] oksoftware: æ¸ãæããã®ãã¦ã£ã¨ãã°ãã㪠[10/01/31 2:04:24] ã¤ã£ãã(javascripter): ãã®å ´åãFirefoxã§ããããããã« [10/01/31 2:04:43] ã¤ã£ãã(javascripter): location.href="javascript:void(mirror.getCode=function(){hoge})" [10/01/31 2:04:46] ã¤ã£ãã(javascripter): ã¨ãããªãããããªã㦠[10/01/31 2:04:56] ã¤ã£ãã(javascripter): ããããmirrorã¯å¤é¨ããã¢ã¯ã»ã¹ã§ããæãã§ãã [10/01/31 2:05:11] oksoftware: ãã¼ã¼ã¼ã¼ã¼ [10/01/31 2:05:55] ã¤ã£ãã(javascripter): ã¾ãupdateFieldã殺ãã®ãæã£åãæ©ã [10/01/31 2:06:06] oksoftware: http://marijn.haverbeke.nl/codemirror/ [10/01/31 2:06:10] oksoftware: ããã ã£ã [10/01/31 2:06:12] oksoftware: mirrorã£ã¦ [10/01/31 2:07:06] oksoftware: ã©ã¤ãã©ãªã£ã¦äºã¯ [10/01/31 2:07:12] oksoftware: æ¢ããé¢æ°ã¨ããç¨æããã¦ããå¯è½æ§ [10/01/31 2:07:48] ã¤ã£ãã(javascripter): mirrorã« [10/01/31 2:07:52] oksoftware: setCode(string) [10/01/31 2:07:52] oksoftware: ãã£ãã¼ã£