
Security News
The Code You Didn't Write Is Still Yours to Defend
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.
superlongjing
Advanced tools
npm install superlongjing
npm run build
文件夹在 dist/jlongjing.min.js
下载git后,使用dist文件夹下的jlongjing.min.js
<script src="./dist/jlongjing.min.js"></script>
小应用调用 包括OS和外置设备(远期支持),如读卡器
主窗口:软件的主窗口 子窗口:通过主窗口新开的子窗口,新窗口是全屏显示的 屏保窗口:无操作时出来的子窗口
窗口发起的函数
升级小应用(离线小应用可以,在线小应用无需升级),升级后重启小应用后生效。
var updateZipUrl = 'http://www.testUpdate.com/update.zip'; // 升级包路径
longjing.upgrade({url: updateZipUrl});
主窗口执行。打开新的子窗口全屏显示,一般启动在在小应用里的链接 离线地址是相对地址 在线地址是绝对地址 注:该方法仅限于在主窗口内使用。
type == offline; // 离线包
path = 'index.html#mall'; // 单页路由
path = 'index.html#/mall'; // 单页路由
path = 'mall/index.html'; // 多页
type == online; // 在线网址
path = 'http://www.xxx.com/xx.html';
longjing.openChildWindow({
type: 'online', // online 在线,offline 离线
path: path
});
子窗口执行。关闭后回到主窗口 注:该方法仅限于在子窗口内使用。
url = 'http://www.xxx.com/xxxx.html'; // 绝对路径的链接
longjing.closeChildWindow(); // 仅关闭子窗口
longjing.closeChildWindow(url); // 关闭子窗口,同时将主窗口的链接变更为url
子窗口执行。部分主窗口的数据需要更新
longjing.refreshMainWindow();
子窗口超过秒数没有任何操作,自动退出回主窗口 入参:
| 名称 | 字段 | 类型 | 说明 |
|---|---|---|---|
| 无操作时长 | time | init |
longjing.setQuitTime({time: 60}); // 60秒
入参:
| 名称 | 字段 | 类型 | 说明 |
|---|---|---|---|
| 唯一标识 | id | string | 当前要播放的唯一标识 |
| 播放文字 | text | string | 播放成语音的文字 |
longjing.voice({id:'当前要播放的唯一标识',text:'播放成语音的文字'});
入参:
| 名称 | 字段 | 类型 | 说明 |
|---|---|---|---|
| 定时器类型 | isOnce | boolean | 默认true,false为循环定时器,true为一次性定时器 |
| 唯一标识 | id | string | 定时器的唯一编号,运行时回调使用 |
| 时长 | time | int | 单位传递的是秒,默认1分钟 |
longjing.createTimerTask({
isOnce: true, // 默认true,false为循环定时器,true为一次性定时器
id: 1001,// 定时器的唯一编号,运行时回调使用
time: 1 // 单位传递的是秒,默认1分钟
});
入参:
| 名称 | 字段 | 类型 | 说明 |
|---|---|---|---|
| 唯一标识 | taskId | string | 创建定时器时入参的id |
longjing.stopTimerTask({
taskId: 1001, // 定时器的唯一编号,创建定时器时发起的。
});
longjing.loadSuccess();
入参:
| 名称 | 字段 | 类型 | 说明 |
|---|---|---|---|
| 颜色状态 | color | int | 0 关闭,1 红色,2 绿色,3 黄色 |
| 类型 | type | int | 1 德睿 2 仟视 |
longjing.changeLed({
color:1,
type:1
});
允许自定义配置
| 名称 | 字段 | 类型 | 说明 |
|---|---|---|---|
| 终端号 | deviceNumber | string | N |
| 商户号 | sellerId | string | N |
| 网点号 | pointNo | string | N |
| 小应用号 | appId | string | N |
var config = longjing.config(); // 获取所有配置,返回json对象
var version = longjing.config('version'); // 获取指定配置
longjing.config('version', 1.0); // 设置单项配置
longjing.config({'version': 1.0}); // 设置多项配置
窗口接收到的事件通知,窗口进行相关业务处理
var options = {}; // 备用参数
longjing.notify('事件编码', function() {
// 处理 ...
}, options);
| 事件编码 | 事件 | 说明 |
|---|---|---|
| ENTER_SCREENSAVERS | 开始屏保 | 主窗口在指定时间内没有操作,会进入屏保窗口 |
| TTS_SPEAK | 播放语音结束 | 文字转语音播放结束,返回播放时传入的唯一标识 |
| APP_SHOW | 页面开始载入 | webview加载页面时,提示加载窗口,用于页面特效执行 |
| TIMER_NOTIFY | 定时器运行通知 | 所有的定时器运行时通过该方法通知 |
FAQs
to bridge app and html5
The npm package superlongjing receives a total of 2 weekly downloads. As such, superlongjing popularity was classified as not popular.
We found that superlongjing demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.