1:新建一个文件夹chrome
新建文件 manifest.json
{
"manifest_version":2,
"name": "coffee",
"version": "1.0",
"description": "coffee test",
"icons":{
"128": "icon.png"
},
"browser_action": {
"default_icon": "icon.png" ,
"default_title": "default title",
"default_popup": "popup.html"
}
}
manifest_version 必选项,目前版本2
name version description icons 几个选项是chrome://extensions/ 插件详情里面的信息
browser_action是chrom右上角显示的相关属性
default_title是鼠标移上去显示的文本,default_popup是单击插件小图标加载的页面
文件夹chrome下还有俩文件
icon.png popup.html
----------------------------------------------------
popup.html的内容如下
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
body {
width: 50px;
}
</style>
</head>
<body>窗口
</body>
</html>
==============================
至此一个简单的chrome插件开发完毕。
讲一下如何打包
先看一下工程目录结构,一个普通的web maven工程
秘钥, 打包的时候chrome会自动生成 webapp.pem