electron

electron应用以管理员权限启动

帅比萌擦擦* 提交于 2021-01-29 09:21:19
最近在用electron开发PC桌面应用,其中有个需求就是整个应用以管理员权限启动。很头痛,各种google,baidu。 最后终于解决了,可以分为三个步骤,做个总结分享。   一、如果没有manifest.xml文件的话 可通过执行命令:mt.exe -inputresource:某某.exe -out:extracted.manifest导出 manifest.xml;   二、如果有的manifest.xml文件的话,按照标红处修改; <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <dependency> <dependentAssembly> <assemblyIdentity type="Win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity> </dependentAssembly> <

Use JMeter Proxy against specific Proxy to record requests

谁说胖子不能爱 提交于 2021-01-29 08:51:13
问题 I have an Electron App which should be started through Proxy Proxy_A. I Would like to make a Loadtest to the Backend. To my basic understanding when I want to record the request using JMeter, I should configure a script recorder which creates a proxy Proxy_B on its own. I should then use JMeter proxy as a proxy to my app so that the traffic could be recorded. Now I am little bit lost. How could I tell JMeter to accepts and forwards the request from my Proxy_A to JMeter Proxy Proxy_B? Edit

Way to read filenames from directory and output to JSON with Electron & React

生来就可爱ヽ(ⅴ<●) 提交于 2021-01-29 08:47:59
问题 I'm trying to make a music player application with Electron & React. I have been able to access music files in a resources/music folder when built and installed but I have to give the exact path to an mp3. I have been trying ways to scan the directory and get all music file names to put in a JSON as the idea is the user could add their own music files to the music folder to be picked up by the app and displayed in a list. Most solutions I see use node fs but i just cnat get it to work. I keep

windows下electron开发应用如何获取管理员权限,通过修改注册表获取管理员权限【转】

狂风中的少年 提交于 2021-01-29 08:24:04
1 const {Registry} = require('rage-edit' ) 2 const {app } = require('electron' ) 3 4 module.exports = (cbSus,cbErr)=> { 5 Registry.set( 6 'HKCU\\Software\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Layers', // 固定,管理员权限应用列表 7 app.getPath('exe'), // 应用路径 8 '~ RUNASADMIN', // 固定写死 符号删除 9 'REG_SZ', // 固定写死 10 ) 11 } // https://blog.csdn.net/Wbiokr/article/details/85780906 通过插件rage-edit修改注册表,从而获取管理员权限 导入,运行即可,在注册表路径,即可看到相关修改 方法二(待验证) 1.生成项目 例如electron,使用electron-packager生成 目的,具有可以运行的exe文件 2.使生成的exe文件具备管理员权限 使用Resource Hacker工具(百度软件中心就可以下载)打开exe文件 修改: 1 < requestedExecutionLevel level =

Asynchronous node js “For” loop with database query

你。 提交于 2021-01-29 07:22:58
问题 Here is the "for" loop to run query(SQLite3 database) for each "id" in an array. qry = "SELECT patients.*, patient_visits.visit_id,patient_visits.patient_id, patient_visits.visitdate, patient_visits.visittime FROM patients LEFT JOIN patient_visits ON patients.id = patient_visits.patient_id "+where+" GROUP BY patients.id ORDER BY patients.id DESC LIMIT "+limit+" OFFSET "+offset; db.all(qry, (err, results) => { if(err){ response.error = err; res.send(response); }else{ response.patients =

get length value from vue observer

坚强是说给别人听的谎言 提交于 2021-01-29 07:01:23
问题 i've developing electron apps with vue-cli-plugin. when print an array it's return observer. what i do: console.log(this.listfile) output from developer tools [__ob__: Observer] 0: {__ob__: Observer} 1: {__ob__: Observer} 2: {__ob__: Observer} 3: {__ob__: Observer} 4: {__ob__: Observer} 5: {__ob__: Observer} 6: {__ob__: Observer} 7: {__ob__: Observer} 8: {__ob__: Observer} 9: {__ob__: Observer} 10: {__ob__: Observer} 11: {__ob__: Observer} 12: {__ob__: Observer} 13: {__ob__: Observer} 14: {_

React.js (w/ Electron) unmounted component state change warning

蹲街弑〆低调 提交于 2021-01-29 06:14:49
问题 I'm currently building an Electron app with React, and I keep getting an error that my state is changing while my component isn't mounted. Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function. in Start (created by Context.Consumer) I've looked up multiple threads and questions about this, and there are no async tasks or

Is there a standard way for an Electron or Node.js app to access system-level icons?

限于喜欢 提交于 2021-01-29 05:33:16
问题 I would like to be able to display system-level application and file icons in Electron-based utilities such as launchers and file-inspectors. Is there a standard way for an Electron or Node.js app to access system-level icons? I have looked in the Electron docs and the closest thing I saw was the entry for represented files in macOS, but I have not yet seen anything about system-level icons being exposed via the Electron APIs. If there is a standard cross-platform Electron or Node.js API for

Jar is not getting executed on MacOS when packaged with electron-packager

人走茶凉 提交于 2021-01-29 05:06:18
问题 Issue Details **Electron Packager Version:14.2.1 **Electron Version:8.2.5 **Operating System:MacOS 10.14.6 Mojave Last Known Working Electron Packager version::8.2.5 Expected Behavior I have created an electron app which will execute a jar file on a specific action in menu bar. I am using nodejs exec(jarfile.jar, callback()) command in the menu action. The jar should get executed and few contents should be written in the local filesystem. This works normally without packaging when I run npm

How can I manage websites settings in electron

∥☆過路亽.° 提交于 2021-01-29 04:11:03
问题 I'm creating a browser using Electron . And it opens websites using webview . <webview id="View" useragent="..." src="https://example.com/" plugins="" preload="file/dir/webview.js" webpreferences="..." enableremotemodule="false" allowpopups=""></webview> Now I've got a question, how can I detect when a website is trying to request access to something using JS / Node ? The explanation of my question: Every website in chrome has its own settings, and they can be access by clicking Site settings