§ Windows外壳使用手册
该文档对应MonkeyShell-v2.0.1.0版本
§ 1.环境安装
.net4.6.2 运行环境
运行
NDP462-KB3151800-x86-x64-AllOS-ENU.exe安装包,按照提示安装即可vc++ 2014 x86运行环境
运行
vc_redist.x86_2015.exe安装包,按照提示安装即可外壳集成chrome内核为cefSharp 81.3.10. 此内核直接集成在外壳之中,无需系统安装
§ 2.外壳安装
解压
MonkeyShell.zip到D盘根目录运行
MonkeyShell\MonkeyShell.exe文件即可打开外壳
§ 3.配置启动路径
配置文件路径
修改
MonkeyShell\ShellConfig.ini配置文件,webView选项中,baserUrl字段- 本地资源访问方式,需要将前端资源统一放置到
MonkeyShell\workspace目录中,使用local:// - 远程资源访问方式,标准的URL方式,
http://或者https
[webView] baseUrl=local://workspace/www_pc/index.html baseUrl=https://www.baidu.com1
2
3- 本地资源访问方式,需要将前端资源统一放置到
§ 4.配置文件
客户端配置文件,ShellConfig.ini 位于程序根目录
| 说明 | 段落名称 | 字段名称 | 类型 | 可选值 | 默认值 |
|---|---|---|---|---|---|
| 新页面默认浏览器内核 | app | webviewType | string | chrome/ie | chrome |
| 主窗口页面显示方式 | app | mainWindowType | string | tab/stack | stack |
| 主窗口显示标题 | app | mainWindowTitle | string | - | "综合业务系统" |
| 通信代理模式 | plugin | comm.mode | string | socket/http/hybrid | |
| 页面启动url | webView | baseUrl | string | - | |
| ie内核版本 | webView | ieVersion | int | IE11 11001 IE11 11000 IE10 10001 IE10 10000 IE9 9999 IE9 9000 IE8 8888 IE8 8000 IE7 7000 | 11000 |
| 页面内导航列表 | webView | navHook | string | 例子(使用逗号分割):open.html,open2.html | '' |
§ 5. 小程序集成
js引入fox-plugins-v1.0.0.js 和fox-v1.3.0.js
<script type="text/javascript" src="libs/plugins/fox-plugins-v1.0.0.js"></script>
<script type="text/javascript" src="libs/fox/fox-v1.3.0.js"></script>
1
2
2
§ 打开小程序
fox.navigator.open(id, name, appType, params, (code, message, data)=>{})
1
参数说明
- id:唯一ID,该ID可用于切换或关闭小程序
- name:小程序对应的工程名或者url,如http://www.baidu.com
- appType: web_app(小程序应用,BS模式)
- params:参数,为json格式, 主要参数{webViewType:"chrome"} chrome或者ie 标记打开的浏览器内核类型
- callbck:回调函数
params参数
| 说明 | 字段 | 类型 | 可选值 | 默认值 |
|---|---|---|---|---|
| 浏览器类型 | webViewType | string | chrome/ie/winformie | chrome |
| 是否打开遮罩 | cover | bool | - | true |
| 浏览器加载url | path | string | - | index.html |
| 页面加载完成后执行脚本 | script | string | - | “” |
| 卡片页标题 | title | string | - | 页面 |
§ 关闭小程序
fox.navigator.remove({},function(code, message ,data){})
1
移除最上层小程序
§ 6.调试工具
焦点停留在浏览器上时,使用Ctrl+F12可以打开对应浏览器内核的调试工具
§ 7.更新配置
st=>start: 开始
e=>end: 结束
startshell=>operation: 启动外壳
checkupdate=>condition: 检查更新配置
updateItem=>operation: 通过外壳对更新程序等进行更新
startUpdate=>operation: 启动更新程序
update=>operation: 更新逻辑
st->startshell->checkupdate
checkupdate(no)->e
checkupdate(yes)->updateItem->startUpdate->update->e
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
外壳程序 配置文件结构
ShellConfig.ini[webView] ;设置启动更新 updateEnable=true [update] ;设置外壳更新文件 Item=Monkey.Update.exe,UpdateConfig.ini1
2
3
4
5
6更新程序配置文件结构
UpdateConfig.ini
; update配置
[update]
;所有更新任务以逗号分割
TaskName=shell,web
KillProcess=MonkeyShell
;更新地址,'|'分割多个版本服务地址, ','分割地址与权重
Address=http://10.211.55.2:8080,70|http://10.211.55.2:8081,30
;更新配置 环境名称
EnvName=dev
;具体更新任务详细配置
[shell]
;安装目录,默认为外壳根目录
InstallDir=
;忽略更新文件及目录,以'\'结尾表示目录
Ignore=Logs\,download\,workspace\,Cef\,Monkey.Update.exe,Monkey.Update.pdb,UpdateConfigList\
;文件下载临时目录
DownloadDir=download
;版本服务器资源存放目录
ServerPath=update/shell
;更新器类型
Type=normal
[web]
InstallDir=workspace
Ignore=
DownloadDir=download
ServerPath=update/web
Type=normal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
插件开发手册 →