在一個 Bolg 上看到一個滿好玩的網站 (http://www.business-opportunities.biz/projects/how-much-is-your-blog-worth/),計算你的 Blog 的價值,呵呵我當然也要來算一下。
當然,這個是趣味為主,不用太在意結果。 ^_^
2005年11月9日 星期三
2005年11月3日 星期四
Firefox 擴充套件 (Extension) 寫作入門之九
擴充套件的認證
- 參考網址
- http://www.mozdevgroup.com/docs/pete/Signing-an-XPI.html
- http://www.mozilla.org/projects/security/pki/nss/tools/certutil.html
- 取得 NSS 工具
- ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_10_RTM/
- 建立 (購買) 憑證
- 利用 NSS 工具來封裝 xpi
Firefox 擴充套件 (Extension) 寫作入門之八
測試與除錯
- 參考網址
- http://kb.mozillazine.org/Setting_up_extension_development_environment
- 測試 - 土法煉鋼
- 除錯 - JavaScript Console
- http://kb.mozillazine.org/JavaScript_Console
function myDump(aMessage) {
var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
.getService(Components.interfaces.nsIConsoleService);
consoleService.logStringMessage("My extension: " + aMessage);
}
Firefox 擴充套件 (Extension) 寫作入門之七
多語、國際化
- XUL
- 建立 .ent (或 .dtd) 檔
<!ENTITY button.label "Click Me!">
<!ENTITY button.accesskey "C"> - 引入
<!DOCTYPE window SYSTEM "chrome://packagename/locale/filename.ent">
- 使用
<button label="&button.label;" accesskey="&button.accesskey;"/>
- JavaScript
- 建立 .properties 檔
key=value
- 引入:使用 nsIStringBundleService/nsIStringBundle 或在 XUL 中建立 <stringbundle>
<stringbundleset>
<stringbundle id="strRes" src="chrome://sample/locale/sample.properties"/>
</stringbundleset>var strRes = null;
strRes = document.getElementById("strRes");
alert(strRes.key);
Firefox 擴充套件 (Extension) 寫作入門之六
擴充套件之安裝設定
- chrome.manifest
- http://developer.mozilla.org/en/docs/Chrome_Manifest
- 範例
content packagename uri/to/files/ [flags]
locale packagename localename uri/to/files/ [flags]
skin packagename skinname uri/to/files/ [flags]
overlay chrome://URI-to-overlay chrome://overlay-URI [flags]
Firefox 擴充套件 (Extension) 寫作入門之五
擴充套件之安裝設定
- contents.rdf
- http://developer.mozilla.org/en/docs/Creating_toolbar_buttons
# 5 The list of commonly overlayed windows with toolbars - 範例
<?xml version="1.0"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<RDF:Seq about="urn:mozilla:package:root">
<RDF:li resource="urn:mozilla:package:myextension"/>
</RDF:Seq>
<RDF:Description about="urn:mozilla:package:myextension"
chrome:displayName="My Extension"
chrome:author="author"
chrome:contributor="contributor"
chrome:name="myextension"
chrome:description="My Simple Extension."
chrome:extension="true">
</RDF:Description>
<RDF:Seq about="urn:mozilla:overlays">
<RDF:li resource="chrome://browser/content/browser.xul"/>
</RDF:Seq>
<!-- overlay for Firefox. -->
<RDF:Seq about="chrome://browser/content/browser.xul">
<RDF:li>chrome://tongwen/content/overlay.xul</RDF:li>
</RDF:Seq>
</RDF:RDF>
Firefox 擴充套件 (Extension) 寫作入門之四
擴充套件之安裝設定
- install.rdf
- http://developer.mozilla.org/en/docs/Install_Manifests
- 產生 GUID - http://developer.mozilla.org/en/docs/Generating_GUIDs
- Target Application GUIDs
Firefox {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
Thunderbird {3550f703-e582-4d05-9a08-453d09bdfdc6}
- 範例
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>myextension@mysite.com</em:id> <!-- (Firefox 1.5 ~ ?) -->
<em:id>{22870005-adef-4c9d-ae36-d0e1f2f27e5a}</em:id> <!-- (Firefox 1.0) -->
<em:version>1.0</em:version>
<em:type>2</em:type>
<!-- Target Application this extension can install into,
with minimum and maximum supported versions. -->
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>1.0+</em:minVersion>
<em:maxVersion>1.5</em:maxVersion>
</Description>
</em:targetApplication>
<!-- Front End MetaData -->
<em:name>Sample!</em:name>
<em:description>A test extension</em:description>
<em:creator>Your Name Here</em:creator>
<em:homepageURL>http://www.foo.com/</em:homepageURL>
</Description>
</RDF>
Firefox 擴充套件 (Extension) 寫作入門之三
擴充套件之安裝設定
- 參考網址
- http://developer.mozilla.org/en/docs/Building_an_Extension
- 安裝方式的演進
- install.js (XPInstall) (Mozilla Suite)
- install.rdf + contents.rdf (Firefox 1.0.x)
- install.rdf + chrome.manifest (Firefox 1.5.x ~ ?)
- install.js
- http://www.mozilla.org/projects/xpinstall/browser_xpi.html
- http://xulplanet.com/references/objref/#xpinstall
訂閱:
文章 (Atom)