Firefox携帯版拡張機能を作るにあたって、対象のGUIDを指定する必要があるわけだが、携帯版には2種類ある。
- スマートフォンのような小さいモバイル機器
- JavaによるNativeUIにバージョン14から切り替わっている
- タブレットPCのような大き目のモバイル機器
var TestClass = (function(){ | |
var _map = new WeakMap; // private variables | |
function TestClass() {} | |
Object.defineProperty(TestClass.prototype, "name", { | |
configurable: true, | |
get: function () { | |
return _map.has(this) ? _map.get(this).name || null : null; | |
}, | |
set: function (val) { | |
var m = _map.has(this) ? _map.get(this) : {}; |
--- messenger.dtd 2010-01-01 00:00:00.000000000 +0900 | |
+++ messenger.dtd.new 2012-09-21 19:46:10.093750000 +0900 | |
@@ -510,6 +510,8 @@ | |
<!ENTITY errorConsoleCmd.label "エラーコンソール"> | |
<!ENTITY errorConsoleCmd.accesskey "E"> | |
<!ENTITY errorConsoleCmd.commandkey "j"> | |
+<!ENTITY clearRecentHistory.label "最近の履歴を削除..."> | |
+<!ENTITY clearRecentHistory.accesskey "H"> | |
<!ENTITY accountManagerCmd.label "アカウント設定..."> | |
<!ENTITY accountManagerCmd.accesskey "S"> |
/* | |
* @example | |
* var tree = { | |
* body: [ | |
* {$: "p", | |
* attrs: { "liberator:highlight": "Hint", }, | |
* child: "hoge", | |
* }, | |
* "text node", | |
* {$: "p", |
seq 100 | perl -nle 'print (($_%3?"":"Fizz").($_%5?"":"Buzz")||$_);' | |
seq 100 | sed -e'0~3s/^.*/Fizz/' -e'0~5s/[0-9]*$/Buzz/' |
# | |
# XPI ファイル作成用 Makefile | |
# | |
# 事前に以下のファイルを Makefile と同じディレクトリに配置すること(要: python) | |
# http://mxr.mozilla.org/mozilla-central/source/config/Preprocessor.py | |
# http://mxr.mozilla.org/mozilla-central/source/config/Expression.py | |
# | |
DIST_DIR = dist |
Firefox携帯版拡張機能を作るにあたって、対象のGUIDを指定する必要があるわけだが、携帯版には2種類ある。
DOM Inspector にイベントリスナのパネルを追加
プロファイルディレクトリ/extensions/inspector@mozilla.org/chrome/inspector.jar
を unzipmkdir content/inspector/viewers/eventListeners/
eventListeners.xul
と eventListeners.js
を content/inspector/viewers/eventListeners/
に配置content/inspector/res/viewer-registry.rdf
にパッチを当てるzip inspector.jar -r ...
でアーカイブ作成function lazyGetter(aObject, aName, aLambda) { | |
Object.defineProperty(aObject, aName, { | |
get: function () { | |
var val = aLambda.call(aObject); | |
Object.defineProperty(aObject, aName, { value: val, writable: true }); | |
return val; | |
}, | |
configurable: true, | |
enumerable : true, | |
}); |
function foo() { | |
return "outer foo"; | |
} | |
var o = { | |
func: function (arg = foo()) { | |
function foo(){ | |
return "inner foo"; | |
} |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Highlight Selector</title> | |
<style> | |
body > p { | |
background-color: #DDD; | |
padding: 0.5em; | |
} |