You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this visual calendar function, using electron, started in 2017, using remote
which opens images related to text values in calendar entries, and pongs them over the screen.
multiple images may be shown concurrently based on calendar entries. they never overlay each other
this is under an app using electron to display a single page web app MagicMirror
I did the new npm install (step 1 of instructions)
this app starts with
our npm start script line
"start": "DISPLAY=\"${DISPLAY:=:0}\" ./node_modules/.bin/electron js/electron.js",
this process does NOT do a 'require' of electron, as it is INSIDE electron
I do the require('@electron/remote/main').initialize(); at the start of electron.js )very first thing, step2 of instructions)
---no browser window is open yet
it calls some extension initializers, (one of which is my code)
I call
const { BrowserWindow } = require("@electron/remote") (step 3 from the instructions)
but I get an error on startup
"@electron/remote" cannot be required in the browser process. Instead require("@electron/remote/main")
but we haven't opened a page yet,
yes I am in the browser 'process', it runs everything
I will use **new BrowserWindow()** to create and load an image, which floats like pong above the single page web app.
I changed my code to do
const { BrowserWindow } = require("@electron/remote/main") (per the message)
I added the require('@electron/remote/main').enable(viewerinfo.webContents) after the window is created, see below
LATER we open the browser window, but the prior code is running on sep thread events (timers). all before main window is opened
code to open single page web a
and I use these webPreferences in the electronOptions object
webPreferences: {
contextIsolation: false,
nodeIntegration: true,
nodeIntegrationInWorker: true
//zoomFactor: config.zoom
},
// Create the browser window.
mainWindow = new BrowserWindow(electronOptions);
mainWindow.loadURL(`${prefix}${address}:${port}`);
some eons later, cal entry causes need for images to be displayed
my call to new BrowserWindow()
I have this visual calendar function, using electron, started in 2017, using remote
which opens images related to text values in calendar entries, and pongs them over the screen.
multiple images may be shown concurrently based on calendar entries. they never overlay each other
this is under an app using electron to display a single page web app
MagicMirror
I did the new npm install (step 1 of instructions)
this app starts with
code to open single page web a
some eons later, cal entry causes need for images to be displayed
my call to new BrowserWindow()
but now new fails.. not a constructor
help
The text was updated successfully, but these errors were encountered: