electron

StaticInjectorError(a)[t -> t]: NullInjectorError: No provider for t

纵然是瞬间 提交于 2019-12-24 05:26:46
问题 I am using Angular 8 with Electron to build a desktop application. I am using nebular theme and have created 2 custom modules and so far they are working fine but i created a sharedModule to export a component from one module for another module but on clicking the respective component making use of that shared Module it started showing me this error StaticInjectorError(a)[t -> t]: StaticInjectorError(Platform: core)[t -> t]: NullInjectorError: No provider for t! Here is my code Shared Module

declare variable in angular in a way that all functions have access to it [duplicate]

杀马特。学长 韩版系。学妹 提交于 2019-12-24 05:26:08
问题 This question already has answers here : Angular 4/5/6 Global Variables (3 answers) Closed 9 months ago . im creating the window variable over and over again how can i declare it only once ? i tried adding it to the constructor but that didn't work. import { Component } from '@angular/core'; import { ElectronService } from 'ngx-electron'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.sass'] }) export class AppComponent { title = 'ae-test'

Which app has the focus when a global shortcut is triggered

試著忘記壹切 提交于 2019-12-24 04:28:10
问题 I use a global shortcut to popup a dialog. But I would like to fill the dialog depending on the application having the focus at the moment the shortcut is triggered. But I can not find a way to do it. I read the extension code here but it's hard to know how to modify the code, and how to recompile electron. If someone have a pointer, that will be greatly appreciated :) 回答1: I couldn't find a way to know which app had the focus before, but I was able to hide my app and return the focus to the

How to send messages to different windows in electron?

岁酱吖の 提交于 2019-12-24 03:43:34
问题 I'm writing my first electron app, so please be lenient :) When the user presses a button on the main Window, there should open a new window which shows some json string. This event gets cought by ipcMain: ipcMain.on("JSON:ShowPage", function(e, item) { createJSONWindow(item); }) This is the function where I create the new window: function createJSONWindow(item) { let jsonWin = new BrowserWindow({ width: 600, height: 800, center: true, resizable: true, webPreferences:{ nodeIntegration: true,

loadHtml instead of loadUrl in atom-shell? (trying to use jade)

落爺英雄遲暮 提交于 2019-12-24 02:44:35
问题 atom-shell only has a method to load HTML from a URL window.loadUrl('file://...') But I want to use Jade var html = jade.renderFile('file://...'); Is there a way to use the compiled html in atom-shell window ? Something like loadHtml(html) ? I suppose I could run an express server that serves compiled html but that would be rather inefficient.. 回答1: In case of a mac: /usr/bin/open -a "/Applications/Google Chrome.app" --args 'data:text/html,<html><body><h1>title</h1><p>text</p></body></html>'

Invoke ActiveX In Electron

血红的双手。 提交于 2019-12-24 01:40:15
问题 I have several activex controls( .cab files) for DSVerify Or DigitalSignature and in the past i use html and load them into ie like: DigitalSign.GetSelCertSign(); ... <object id="DigitalSign" codeBase="DigitalSign.NJGGZY.x86.cab#version=3,0,0,1" classid="clsid:AE9C27E1-AF18-48A6-8087-026064B130D5"></object> and now i want to use electron as cross-platform runtime, but i don't know how to invoke these activex plugins in electron , or how to embeded ie in electron? 回答1: It's not possible, sorry

Error with ffi module node.js Uncaught Error: Dynamic Linking Error: Win32 error 193

懵懂的女人 提交于 2019-12-24 01:38:17
问题 I want to call a function, which is written in "C" DLL, from node.js JavaScript. I am using "ffi" module in node.js and electron. The function which I want to call is "int FDColor_GetSWVersion(char* softwareVersion)". I am using the below code: var libm = ffi.Library(__dirname + "\\viewmodels\\FDColor.dll", { 'FDColor_GetSWVersion': [ 'int', ['string' ] ] }); But I am getting the error: Uncaught Error: Dynamic Linking Error: Win32 error 193 回答1: It looks like that error means you have a 32/64

PNG files not found in ASAR

谁都会走 提交于 2019-12-24 01:33:05
问题 I have an Electron (1.7.10) application that is reporting it can't find 5 of 7 PNG files in my ASAR. All 7 PNGs are in the same folder, and 2 of them are displayed on screen fine. The other 5 report net::ERR_FILE_NOT_FOUND . All src attributes for the img tags are dynamically generated and use relative paths ( assets/images/MyImage.png ). If I extract the ASAR, I can see the files in there, in the correct folder (as referenced by the src attribute). If I use the console to set the location of

Disable zooming (both pinch zoom and smart zoom [mac]) in electron

大兔子大兔子 提交于 2019-12-24 00:11:07
问题 Does anyone have a working solution to disable all kinds of zooming in electron v0.35.0? (including pinch zoom and smart zoom (on mac)) 回答1: Add following to render process: var electron = require('electron'); electron.webFrame.setZoomLevelLimits(1, 1); See Disable pinch zoom in webkit (or electron) 来源: https://stackoverflow.com/questions/33962824/disable-zooming-both-pinch-zoom-and-smart-zoom-mac-in-electron

Why does my Electron app quit when closing a Renderer window?

我怕爱的太早我们不能终老 提交于 2019-12-23 21:37:36
问题 I'm testing on Windows. The app sets up a Tray menu on 'ready', with an 'About' label. When clicked, it shows a BrowserWindow: var aboutBox = new BrowserWindow({ width: 460, height: 176, useContentSize: true, icon: iconImg, maximizable: false, fullscreenable: false, resizable: false, minimizable: false }); and then, when the user clicks on OK, closing it with: const remote = require('electron').remote; remote.getCurrentWindow().close(); causes the app to exit. Why? 回答1: In your main.js you