在新建的文件夾下有如下三個文件:
[list]
[*]manifest.json
[*]icon.png
[*]popup.html
[/list]
icon.png是顯示在chrome工具的圖標,popup.html是彈出窗口的顯示,而manifest.json是chrome extension的配置文件,指定圖標,內容文件等。
[b]manifest.json[/b]的內容如下:
{
"name": "My First Extension",
"version": "1.0",
"description": "The first extension that I made",
"browser_action": {
"default_icon": "icon.png",
"popup": "popup.html"
},
"permissions": [
"http://api.flickr.com/"
]
}
browser_action說明這個擴展是一個[i]browser action[/i]。[b]manifest.json[/b]完整格式請參考:[url]http://code.google.com/chrome/extensions/manifest.html[/url]
用chrome打開[url]chrome://extensions/[/url],即chrome擴展程序頁面,點擊按鈕"載入正在開發的擴展程序",在文件窗口中選擇如上擴展程序所在文件夾即可。chrome將載入正在開發的extension。在該頁面中可以打擴展程序,可以重新加載或卸載正在開發的extension.
[img]http://dl.iteye.com/upload/attachment/380154/12673b2f-be43-3ff2-aa53-20dab4885145.png[/img]