This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getFunctionName(fn) { | |
| return fn.name || ('' + fn).replace(/^function|\s*\([\s\S]+|(?:\s*\/(?:\/.*|\*[\s\S]*?\*\/)\s*)*/g, '') || 'anonymous'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name altTooltip.uc.js | |
| // @description title がなければ alt を出す | |
| // @include main | |
| // @compatibility Firefox 3.5+ | |
| // @namespace http://twitter.com/xulapp | |
| // @author xulapp | |
| // @license MIT License | |
| // @version 2010/04/01 21:00 +09:00 | |
| // ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function xml2dom(xml, doc) { | |
| xml = <root xmlns={ doc.documentElement.namespaceURI }/>.appendChild(xml); | |
| var settings = XML.settings(); | |
| XML.prettyPrinting = false; | |
| var root = new DOMParser().parseFromString(xml.toXMLString(), 'application/xml').documentElement; | |
| XML.setSettings(settings); | |
| doc.adoptNode(root); | |
| var range = doc.createRange(); | |
| range.selectNodeContents(root); | |
| var frag = range.extractContents(); |
NewerOlder