mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
初始化模板
This commit is contained in:
parent
64ec9374dd
commit
e285c8b14b
19
manifest.json
Normal file
19
manifest.json
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"manifest_version": 1,
|
||||||
|
"type": "extension",
|
||||||
|
"name": "插件模板",
|
||||||
|
"slug": "plugin_template",
|
||||||
|
"description": "LiteLoaderQQNT的插件模板",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"author": [
|
||||||
|
{
|
||||||
|
"name": "沫烬染",
|
||||||
|
"link": "https://github.com/mo-jinran"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"injects": {
|
||||||
|
"renderer": "./src/renderer.js",
|
||||||
|
"main": "./src/main.js",
|
||||||
|
"preload": "./src/preload.js"
|
||||||
|
}
|
||||||
|
}
|
20
src/main.js
Normal file
20
src/main.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// 运行在 Electron 主进程 下的插件入口
|
||||||
|
|
||||||
|
|
||||||
|
// 加载插件时触发
|
||||||
|
function onLoad(plugin, liteloader) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 创建窗口时触发
|
||||||
|
function onBrowserWindowCreated(window, plugin) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 这两个函数都是可选的
|
||||||
|
module.exports = {
|
||||||
|
onLoad,
|
||||||
|
onBrowserWindowCreated
|
||||||
|
}
|
8
src/preload.js
Normal file
8
src/preload.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
// Electron 主进程 与 渲染进程 交互的桥梁
|
||||||
|
const { contextBridge } = require("electron");
|
||||||
|
|
||||||
|
|
||||||
|
// 在window对象下导出只读对象
|
||||||
|
contextBridge.exposeInMainWorld("plugin_template", {
|
||||||
|
|
||||||
|
});
|
20
src/renderer.js
Normal file
20
src/renderer.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// 运行在 Electron 渲染进程 下的页面脚本
|
||||||
|
|
||||||
|
|
||||||
|
// 页面加载完成时触发
|
||||||
|
function onLoad() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 打开设置界面时触发
|
||||||
|
function onConfigView(view) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 这两个函数都是可选的
|
||||||
|
export {
|
||||||
|
onLoad,
|
||||||
|
onConfigView
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user