Skip to content

Instantly share code, notes, and snippets.

@xulapp
xulapp / js.cfg
Created December 26, 2009 10:08
otbedit の JavaScript 用設定ファイル
// language setttings for JavaScript
KeywordNocase:FALSE
KeywordFile:js.txt
OpenComment:/*
CloseComment:*/
RowComment://
BreakChars: ,.:;(){}[]'"=><-|&*+-/%!?^
OperatorChars:=!&|^~*/+-%<>;:.,(){}[]
BracketChars:)}
QuoteChars:"'
@xulapp
xulapp / gmtrap.htm
Created February 1, 2010 03:36
unsafeWindow に対していろいろやってみるテスト
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body></body>
<script>
var body = document.body;
@xulapp
xulapp / bindTabOwner.uc.js
Created February 8, 2010 14:14
bindTabOwner.uc.js (selectOwnerOnClose)
// ==UserScript==
// @name bind tab owner
// @description select owner tab on close tab
// @include main
// @compatibility Firefox 3.5 3.6
// @namespace http://twitter.com/xulapp
// @author xulapp
// @license MIT License
// @version 2010/02/28 04:50 +09:00
// @note set browser.tabs.selectOwnerOnClose for true[default]
@xulapp
xulapp / selectElementByMiddleClick.uc.js
Created February 23, 2010 14:40
selectElementByMiddleClick.uc.js
// ==UserScript==
// @name selectElementByMiddleClick.uc.js
// @description DOM Inspector -> Select Element By Click
// @include chrome://inspector/content/inspector.xul
// @compatibility Firefox 3.*
// @namespace http://twitter.com/xulapp
// @author xulapp
// @license MIT License
// @version 2010/02/23 23:40 +09:00
// ==/UserScript==
@xulapp
xulapp / xml2dom.js
Created February 28, 2010 13:37
xml2dom
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();
@xulapp
xulapp / betterConsole.uc.js
Created February 28, 2010 16:29
betterConsole.uc.js
// ==UserScript==
// @name betterConsole.uc.js
// @description eval in [content, chrome, WrappedNative] window under the JS version [default, 1.6, 1.7, 1.8]
// @include chrome://global/content/console.xul
// @compatibility Firefox 3.6+
// @namespace http://twitter.com/xulapp
// @author xulapp
// @license MIT License
// @version 2010/04/03 16:10 +09:00 細かなミスを修正。3.7a3 で動作確認
// ==/UserScript==
@xulapp
xulapp / backforwardButtonTooltip.uc.js
Created March 1, 2010 19:07
backforwardButtonTooltip.uc.js
// ==UserScript==
// @name backforward button tooltip
// @description replace tooltiptext with target URL and Title
// @include main
// @compatibility Firefox 3.5+
// @namespace http://twitter.com/xulapp
// @author xulapp
// @license MIT License
// @version 2010/02/07 00:00 +09:00
// ==/UserScript==
@xulapp
xulapp / menu-menu.uc.js
Created March 3, 2010 23:48
menu-menu.uc.js
// ==UserScript==
// @name menu-menu
// @description compact menubar
// @include main
// @compatibility Firefox
// @namespace http://twitter.com/xulapp
// @author xulapp
// @license MIT License
// @version 2010/03/04 08:00 +09:00
// ==/UserScript==
@xulapp
xulapp / moreToolsMenu.uc.js
Created March 3, 2010 23:49
moreToolsMenu.uc.js
// ==UserScript==
// @name moreToolsMenu.uc.js
// @description adds moreTools-menu to menubar
// @include main
// @compatibility Firefox
// @namespace http://twitter.com/xulapp
// @author xulapp
// @license MIT License
// @version 2011/04/03 15:30 +09:00
// ==/UserScript==
@xulapp
xulapp / callable.js
Created March 12, 2010 07:51
__call__ in JavaScript
function Callable() {
var self = function Callable()
this.__call__.apply(this, arguments);
self.__proto__ = Callable.prototype;
return self;
}
Callable.prototype = {
constructor: Callable,
__proto__: Function.prototype,
__call__: function __call__() {