//app 应用 import chrome.app; //调用系统 Edge(Chromium)、Chrome、Supermium 等 Chromium 内核浏览器写软件界面 //XP、Win7 系统可使用 Supermium 以支持新 Chromium 内核。 var theApp = chrome.app(); //指定允许chrome中使用JS直接调用的函数 theApp.external = { test = function(){ theApp.msgbox("页面js调用了aardio函数"); } //如果函数名第一个字符是$,则第一个回调参数$用于表示当前客户端,可作为xcall的参数使用 $test = function($){ theApp.xcall($,"js函数") } tag = function(strs,...){ var args = {...} for(i=#args;1;-1){ table.insert(strs,args[i],i+1); } strs = string.join(strs); return strs; } } //虚拟一个服务端页面,如果在工程里直接添加一个文件到工程就可以了 //因为 /res/ 已设为 theApp.http.documentBase,这里不用再写 "/res/index.aardio" theApp.httpHandler["/index.aardio" ] = /*** aardio 调用 chrome
	如果使用webpack等构建前端项目。
	前端工程中直接执行 npm i aardio 安装aardio.js即可。
	然后JS中直接调用 import aardio from 'aardio' 引入aardi.js
	即可使用aardio对象( 已经做好了智能提示,可在d.ts中添加更多external接口函数 )
	
	chrome.app支持系统已安装的Chrome、或其他兼容Chrome启动参数的浏览器,
	并且可以支持即将成为WIN7,WIN10默认系统浏览器的Edge(Chromium版)
	
***/ //此函数参数指定的回调函数会在网页端准备就绪后执行 theApp.indexReady( function($){ //参数 $ 表示当前连接到 aardio 的网页客户端 theApp.doScript($,` alert("在 aardio 里执行了 JavaScript 代码") `) } ) //可选在调用 start 函数前用 theApp.setPos 或 theApp.center 调整窗口位置 theApp.center(); /* 正式启动 Chrome 进程, 如果文件名为 index.html 或 index.aardio,目录 "/res/" 会自动设为 theApp.http.documentBase。 之后网页访问 "/index.aardio" 会自动转为 "/res/index.aardio" 。 */ theApp.start("/res/index.aardio"); //网页中可以调用 aardio.quit() 退出,也可以直接关闭 Chrome 窗口退出 win.loopMessage();