electron

How to remove tooltip from [mat-icon] button in an Electron application?

你离开我真会死。 提交于 2020-02-23 04:09:51
问题 I need to remove the tooltip from the button. I'm using Angular/Electron for a desktop application. I have the following code in the .html file: <button class="close-button" (click)='closeDialog()'> <mat-icon class="svg-mat-icon" svgIcon="menu_cancel"></mat-icon> </button> This is the 'X' button in the upper-right corner of the screen. When I hover the mouse over it I get a tooltip "menu_Cancel" above it. How can I remove that tooltip? The button is self-explanatory, and the user does not

Electron architecture API calls

送分小仙女□ 提交于 2020-02-23 03:41:11
问题 Hello Stackoverflow Community, I'm currently diving in into cross-platform apps with Electron. As I'm a newbie to this topic there are some uncertainties: In "normal" webdevelopment I would write an API in Go(lang) which processes JSON files. Is it possible to set up Electron like an offline server which can make API calls? Thank you in advance. I really appreciate your help. 回答1: Yes, it is possible and and here is a library go-astilectron that demonstrates this approach. You can read more

搭建Linux(Ubuntu)系统下的Differential Datalog运行环境

那年仲夏 提交于 2020-02-22 22:46:15
DDlog is a bottom-up , incremental , in-memory , typed Datalog engine. It is well suited for writing programs that incrementally update their output in response to input changes DDlog 是一种自底向上,增量式,基于内存的类型化Datalog引擎,它非常适合编写响应输入更改而增量更新其输出的程序。目前官方说明文档介绍的安装方式,只在Linux和maxOS上经过了验证,未介绍Windows平台下运行环境搭建的方法。最近因为学习需要,自己在Liunx(Ubuntu 18.04) 系统下,经过一番折腾,终于把编译运行环境搞定,这里做个记录。 官方文档-Installation 主要依赖Haskell 编译环境和对应的stack管理工具,以及rust编译环境 推荐方案:electron-ssr 访问外网 + 执行官方安装脚本 。如果不能访问外网,可以考虑修改安装脚本,将下载源改成 tuna 源或 ustc 源,但是考虑到编译运行环境的依赖关系较为复杂,此方法若非万不得已,还是不要用了,费时费力,浪费感情!(良心建议~) 1. 配置、使用electron-ssr 由于 electron-ssr

electron在windows打包遇到的坑纪录

情到浓时终转凉″ 提交于 2020-02-21 11:37:48
1.解决跨域的问题 之前是使用后端解决跨域的,但是现在条件不允许,所以要使用前端进行跨域 第一种方法: const server = new WebpackDevServer( compiler, { contentBase: path.join(__dirname, '../'), quiet: true, proxy: { '/api': { // 请求的目标服务器地址 target: 'http://xxxx', // 设置允许跨域 changeOrigin: true, // 重写路径 pathRewrite: { '^/api': '' }, headers: { referer: '' } } }, before (app, ctx) { app.use(hotMiddleware) ctx.middleware.waitUntilValid(() => { resolve() }) } } ) 在dev-runner.js里面设置,然后axios里面使用/api/加后面的url就可以了,但是这种方法会导致build包的时候出现问题,file not find 第二种方法: mainWindow = new BrowserWindow({ //... webPreferences: { webSecurity: false, //... }, }); 直接关闭

How to use preload.js properly in Electron

喜欢而已 提交于 2020-02-21 09:59:27
问题 I'm trying to use Node modules (in this example, fs ) in my renderer processes, like this: // main_window.js const fs = require('fs') function action() { console.log(fs) } Note: The action function gets called when I press a button in my main_window . But this gives an error: Uncaught ReferenceError: require is not defined at main_window.js:1 I can solve this issue, as suggested by this accepted answer, by adding these lines to my main.js when initializing the main_window : // main.js main

electron菜单的基本使用

爱⌒轻易说出口 提交于 2020-02-19 13:43:36
对electron了解之后,让我们学习创建一个窗口,使用自己的编写的窗口 搭建环境可以看 https://www.cnblogs.com/zhoulifeng/p/12306050.html Menu菜单 创建一个menu.js文件,编写一下代码,结构相当于JSON格式的 const { Menu } = require('electron') const template = [{ label: '首页' }, { label: '新闻资讯', submenu: [{ label: '国内新闻', submenu: [{ label: '北京新闻' }, { label: '河南新闻' }] }, { label: '国际新闻' }] }, { label: '娱乐', submenu: [{ label: '音乐' }, { label: '电影' }, { label: '综艺' }] }, { label: '科技', submenu: [{ label: 'Al' }, { label: '手机' }, { label: '互联网' }] } ] var list = Menu.buildFromTemplate(template) Menu.setApplicationMenu(list) 创建主入口文件main.js文件 在ready生命周期中,直接加入下面的代码,

How to debug electron production binaries

北慕城南 提交于 2020-02-18 05:00:28
问题 I can't open devtools in the built version of my electron app. Therefore i want to find another solution to log any errors that only occur in the production version. Is there any good way to get some console.logs from an electron application if its already built? Obviously i can debug the “development” version (running npm run dev) of my electron app by opening the chrome dev tools. But i can’t find any way to enable them inside my production application. I am using the newsest version of

How to debug electron production binaries

ぐ巨炮叔叔 提交于 2020-02-18 04:59:08
问题 I can't open devtools in the built version of my electron app. Therefore i want to find another solution to log any errors that only occur in the production version. Is there any good way to get some console.logs from an electron application if its already built? Obviously i can debug the “development” version (running npm run dev) of my electron app by opening the chrome dev tools. But i can’t find any way to enable them inside my production application. I am using the newsest version of

How to debug electron production binaries

心已入冬 提交于 2020-02-18 04:59:04
问题 I can't open devtools in the built version of my electron app. Therefore i want to find another solution to log any errors that only occur in the production version. Is there any good way to get some console.logs from an electron application if its already built? Obviously i can debug the “development” version (running npm run dev) of my electron app by opening the chrome dev tools. But i can’t find any way to enable them inside my production application. I am using the newsest version of

Electron-builder desktop shortcut icon has to be enabled manually

风流意气都作罢 提交于 2020-02-16 10:42:46
问题 When I create and install an executable using Electron-Builder, the desktop shortcut instead displays an Electron icon. I have to manually Change Icon... for icon.ico to take effect. "target": "nsis", "icon": "assets/icon_256.ico", "nsis": { "installerIcon": "assets/icon.ico", "uninstallerIcon": "assets/icon.ico", "installerHeaderIcon": "assets/icon.ico" } // I have also tried this, which also produces the same issue. "win": { "target": "nsis", "icon": "assets/icon_256.ico" } Is there a way