Skip to content

Instantly share code, notes, and snippets.

@teramako
teramako / js-ctypes-memo.md
Created February 9, 2010 12:59
Fx3.6で導入されてるctypes.jsmメモ

js-ctypes

js-ctype に関するメモ

これは何か

  • JavaScriptからバイナリモジュール内の関数の直実行を可能にする
  • cライブラリの関数を呼び出すなど
@teramako
teramako / thunderbird-go-menu.memo.md
Created February 21, 2010 06:18
XULのメニューやボタンなどのenabled/disabled管理

Thunderbird の「移動」メニュー追跡

メニューの enabled/disabled の仕方を追った。

基礎知識

  • controller は window.controllers.appendController メソッド等から登録する
  • controller とは以下のメソッドを備える
  • supportsCommand (cmdName) // そのコントローラが管理する cmdName なら true を返すこと
@teramako
teramako / test-redirect.js
Created February 21, 2010 17:46
get Redirected URL - Vimperator Plugin
/*
* get Redirected URL - Vimperator Plugin
* Command:
* :testurl {URL}
*/
function getRedirectedURL(url){
if (typeof url != "string")
throw new TypeError("url must be string");
let uri = util.newURI(url);
if (!uri.schemeIs("http") && !uri.schemeIs("https"))
@teramako
teramako / opener-ex.js
Created February 22, 2010 00:53
opener-ex.js - VimperatorPlugin
/**
* Vimperator-Plugin
* @see http://vimperator.g.hatena.ne.jp/voidy21/20100119/1263907211
* @see http://vimperator.g.hatena.ne.jp/nokturnalmortum/20100120/1263927707
* @see http://vimperator.g.hatena.ne.jp/teramako/20100221/1266774716
* @require _libly.js
*/
let U = liberator.plugins.libly.$U;

chrome://browser/content/browser.xul

<tabbrowser ... onclick="return contentAreaClick(event, false);"/>

chrome://browser/content/browser.js

contentAreaClick (event, fieldNormalClicks)

@teramako
teramako / personas.js
Created March 7, 2010 09:53
personas.js - Vimperator Plugin
// Vimperator plugin for personas
/*
Command:
:personas {id}
change to {id}'s theme
:personas null
use default theme
:personas {id} -c[color] {color}
@teramako
teramako / sweets-mine.vimp
Created March 9, 2010 12:52
ペルソナ用にカスタマイズしたsweets.vimp
" ==Vimperator_Color_Scheme==
" name: Sweets
" ==Sweets_Color_Scheme==
hi Hint font-family: monospace; font-size: 15px; font-weight: normal; color: lightyellow; background-color: black; border-color: ButtonShadow; border-width: 0px; border-style: solid; padding: 0px 5px;
hi HintElem background-color: pink; color: black;
hi HintActive background-color: hotpink; color: white;
hi StatusLine color: DeepPink; background: rgba(0,0,0,0.7); font-weight: normal; font-size: 10pt;
@teramako
teramako / toPixel.html
Created March 15, 2010 08:44
画像のピクセルデータを■の羅列で塗りなおす
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>TwitterIconPixels</title>
<script type="text/javascript" src="toPixel.js"></script>
</head>
<body onload="init()">
<h1>Twitter Icon Pixels</h1>
<canvas id="can" width="16" height="16"></canvas>
<pre id="debug"></pre>
@teramako
teramako / editWindow.js
Created April 17, 2010 07:35
Vimperator plugin: RichTextEditorのHTMLを外部エディタで編集
/*
* RTE (RichTextEditor) を外部エディタで編集するプラグイン
* http://www.kevinroth.com/rte/demo.htm
* などで試してみよう
*
* フォーカスしてから、<C-S-I> でエディタが立ち上がるはず。
* もちろん 'editor' オプションがきちんと設定されていること
*/
let nsIR = Ci.nsIInterfaceRequestor;
@teramako
teramako / bartab-integration.js
Created April 26, 2010 13:32
BarTab integration - Vimperator Plugin
/*
* BarTab integration - Vimperator Plugin
*
* Commands:
* :tap tap the current tab
* :tap # tap the previous seleced tab
* :tap {num}:? tap the {num}-th tab
* :tap! tap all tabs without the current tab
*
* Tab Completion is available !!