Tag: 电子

在Webpack中使用节点通告器

我编写了一个用create-react-app(我使用Webpack和Babel)创build的Electron项目。 我想使用节点通知符,但是我在configurationWebpack时遇到了问题(我认为)。 通知调用的代码是从repo的自述文件复制粘贴。 我目前的Webpackconfiguration(我设法取消所以没有错误)是: node: { fs: 'empty', net: 'empty', tls: 'empty', child_process: 'mock', __filename: true, __dirname: true }, externals: [ 'ws' ], target: 'electron' 有没有人有一个如何configuration的想法? 我做错了什么,没有通知显示?

在Vue中dynamic改变CSS

有没有办法改变css属性asynchronous? 我有完整的访问node , vue ,它是坐在一个chrome浏览器,我需要更新CSS的文本是不同的页面长,所以浏览器缓慢爬行,而CSS正在申请。 fontSize (newSize) { document.getElementById('text').style.fontSize = `${newSize}px` } 我需要修改它以更好地更新页面,我不知道如何去做。 我在看async模块,但它非常密集,我不是100%确定它提供了我所需要的。

我无法在v-for loop |中绑定图像源 vue.js,node.js

我尝试在v-for循环中绑定图像源。 我的数组是由函数填充,而不是静态的。 我的代码看起来像: <section class="section"> <div class="container"> <div v-for="match in matches" class="card"> <img :src="match.avatar" alt=""> </div> </div> </section> 和 created() { ipcRenderer.send('get:all:champions') ipcRenderer.send('summoner:recent:matches:request') ipcRenderer.on('summoner:recent:matches:response', (event, matches) => { matches.splice(-15, 15) // -15, 15 this.matches = matches for (let match in matches) { ipcRenderer.send('matches:champion:avatar:request', { element: match, championId: matches[match].champion }) } ipcRenderer.on('matches:champion:avatar:response', (event, data) => { […]

从Electron主脚本触发点击

我怎样才能触发从电子主脚本button点击? 在我的项目中,我有一个带有一个button的HTML文件,我想模拟点击,一个JavaScript文件,我定义了一些使用JQuery的行为和主要的JavaScript文件,这是主要的电子过程。 Electron的主进程应该向渲染进程发送一个命令来触发button点击,但是我无法从main.js访问渲染。 我必须做些什么select?

电子(node.js)窗口上的空白区域

我用节点8.4使用Electron 1.6.11开发桌面应用程序。 这是我的主窗口通常是这样的: 但有时窗口的某些部分将会与空白区域重叠,原因不明。 喜欢这个: 这个空白区域将会消失,如果我点击button之一或调整窗体,或任何使它再次呈现(我国)。 而且,这个空白区域只出现在表单的左侧。 即时通讯使用CSS网格来安排我的组件,可能是因为这个? 任何build议表示赞赏

使用Electron来使用RESTful API

在显示我的Electron应用程序的任何窗口(使用Electron应用程序作为客户端)之前,我想为RESTful API提出一些请求(GET,POST,PUT …)。 是否有可能使用ClientRequest来做到这一点? 会有人有一个例子吗? 非常感谢你。

Electron:__是针对不同版本的Node.js编译的

当试图使用electron-installer-dmg在macOS Sierra上打包电子应用程序时,我得到以下结果: Error: The module '/Users/august/projects/node_modules/macos-alias/build/Release/volume.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 54. This version of Node.js requires NODE_MODULE_VERSION 57. Please try re-compiling or re-installing the module (for instance, using `npm rebuild` or `npm install`). at Object.Module._extensions..node (module.js:598:18)<br> at Module.load (module.js:503:32)<br> at tryModuleLoad (module.js:466:12)<br> at Function.Module._load (module.js:458:3)<br> at Module.require (module.js:513:17)<br> at require […]

通过HTML加载D3模块与节点需求语句

问题 执行以下代码会根据模块的加载位置而产生不同的结果。 d3.tsv("data.tsv", function(error, data) { if (error) throw error; console.log(data); } 当D3库加载到html文件中时,使用下面的脚本标签 <script src="node_modules/d3/build/d3.js" type="text/javascript"></script> 在上面的例子中,data data.tsv中的data按照预期被导入到variablesdata中。 当从节点terminal(REPL)或脚本导入库时,如下所示, data的内容最终为三个对象数组,其中所有对象都包含Error: connect ECONNREFUSED 127.0.0.1:80 。 let d3 = require('d3'); d3.tsv("data.tsv", function(error, data) { if (error) throw error; console.log(data); } 放弃 这是一个电子应用程序,问题发生在渲染过程而不是主要过程。 D3正被用来组件UI。 浏览器安全性如下,解释如何通过本地托pipe文件(如使用本地Web服务器)或使用Electron API 访问本地文件轻松解决此问题。 题 如前所述,D3文档小组解释说, 浏览器安全限制了文件的访问 ,但是这两个import之间的function差异是什么,为什么它只能以一种方式工作,而不是另一种?

电子应用程序与多个选项卡式浏览器窗口连接到https网站

我正尝试使用Electron创build我自己的http://meetfranz.com/版本。 该应用程序应允许多个URL,如https://messenger.com/和https://gmail.com/可见,并有一个选项卡式界面。 我已经尝试生成Webview和BrowserWindow。 WebView似乎无法完全加载Messenger(不加载login) BrowserWindowpopup主窗口… 我之前也尝试过使用iFrames,这是一个不好的方法。 任何想法最好的方式来实现一个允许cookie / HTTPS的最小浏览器界面? 的index.html <html> <head> <style> webview { display: inline-flex; width: 800px; height: 600px; } </style> </head> <body> <form name="form"> <input name="input" placeholder="https://messenger.com/" value="https://messenger.com"> <button type="submit">submit</button> </form> <div class="tabs"> </div> <div class="webviews"> </div> <!–<webview src="https://messenger.com/" autosize="on" nodeintegration="on" disablewebsecurity="on" webpreferences="allowRunningInsecureContent"></webview>–> <script type="text/javascript"> require('./app.js') </script> </body> </html> main.js const {app, […]

多窗口pipe理:从窗口列表中删除窗口

描述 在我的电子程序中,我将所有可见的渲染器窗口存储在主进程中的单链表中。 当创build一个新的,它被添加到列表,但我不知道如何将它们从列表中删除时再次closures(找出哪个列表元素分别)。 代码在主stream程中 global.windows = new LinkedList(); function createWindow(p_URL, p_width, p_height, p_x, p_y, p_minWidth, p_minHeight, p_parent, p_icon) { // Create the browser window. let win; win = new BrowserWindow({width: p_width, height: p_height, minWidth: p_minWidth, minHeight: p_minHeight, parent: p_parent, icon: p_icon, show: false}); global.windows.insert(win); if(p_URL !== undefined) win.loadURL(p_URL) win.once('ready-to-show', () => { win.show() }); console.log("added: […]