alex8088 / electron-toolkit Goto Github PK
View Code? Open in Web Editor NEWToolkit for Electron
License: MIT License
Toolkit for Electron
License: MIT License
我开发了一个适用于electron主进程的IOC 服务治理管理小工具,想发布在@electron-toolkit这个npm 组织下,不知道是否可以,这个是我的代码仓库:https://github.com/heychenfq/electron-toolkit
不知道怎么联系您,只能在仓库里提交issue了。
not yet
No response
No response
It wasted me hours figuring out why ipcRenderer.postMessage
has no effect at all. 😂
Then I read the source code and found out if contextIsolated
is enabled, the function just returns silently, which I believe is a bad practice.
2.0.0
25.6.0
I can't using sendSync on App.vue but send and on it ok.
const data = await window.electron.ipcRenderer.sendSync('chanel', 'value')
data always return undefined.
I think it is a bug
^1.0.2
^21.3.0
I use optimzer from @electron-toolkit/utils
It only ignores CommandOrControl + R, but when I press CommandOrControl + Shift + R it still reloads the page.
// Default open or close DevTools by F12 in development
// and ignore CommandOrControl + R in production.
// see https://github.com/alex8088/electron-toolkit/tree/master/packages/utils
app.on('browser-window-created', (_, window) => {
optimizer.watchWindowShortcuts(window)
})
How can I avoid CommandOrControl + Shift + R?
^2.0.1
27.0.1
主进程:
setInterval(() => {
mainWindow.webContents.send("sendMessage", {id: 1, type: 4})
}, 5000);
渲染进程,vue组件
onMounted(()=>{
window.electron.ipcRenderer.on('sendMessage',getMessage)
})
onBeforeUnmount(()=>{
window.electron.ipcRenderer.removeListener('sendMessage',getMessage)
})
const getMessage=(val,message)=>{
console.log(val);
console.log(message);
}
组件销毁后,依旧能接收消息并在控制台打印,频繁创建销毁该组件,打印次数会累加
3.0.0
28.2.0
in function optimizer.watchWindowShortcuts.
2nd parameter's property escToCloseWindow is Not work.
the code just read window.close
property, but not run it.
in code https://github.com/alex8088/electron-toolkit/blob/master/packages/utils/src/optimizer.ts#L68
if (escToCloseWindow) {
if (input.code === 'Escape' && input.key !== 'Process') {
window.close // <-- HERE!
event.preventDefault()
}
}
latest
any
According to the Electron documentation, @electron-toolkit/preload
is unsafe as it provides the renderer process the ability to send arbitrary IPC messages.
This problem isn't easy to solve without completely deprecating preload
, seeing as it is designed to facilitate this practice. I believe it would be best to deprecate. If one wants to leak IPC, then they should disable context isolation, since context isolation is only designed around providing application API methods to the renderer process, not Electron API methods.
No response
No response
Why is there only 3 electron api's available with import { electronAPI } from '@electron-toolkit/preload'
?
process, ipcRenderer, webFrame
.
Example : I want to use the api for app
to get the data path app.getPath('appData')
.
Importing app
in ../preload/index.ts
import { app, contextBridge } from 'electron'
shows app
as undefined
.
Now how am i supposed to get access to those other electron api's ?
3.0.0
28.2.0
I have converted an existing application from vue-cli to vite and have tried using electron-vite and toolkit but I am having an issue with the preload and ipcHelper.
I am getting the following error which seems to be from electron loading.
Create a full working with preload and ipc communication like electron-vite-boilerplate.
No response
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.