Need help working on my Linux store


Hey guys I am working on a web store for Linux, I have been working on a website for it all and have been having issues with it in the desktop application I am making where it doesn’t render the website at all and looking in the console hardly shows any of the actual website code which is a Wix domain, does anyone have any ideas why this would happen?


Hard to say without seeing both the code and the result.


Show us the code. :eyes: :eyes: :eyes: :eyes:


Sure here is the code of the application

and the index.html

and what happens when I open it in the application

as well as what it’s suppose to look like when viewed in chrome for example


The code in index.html redirects the page to your “store”, why would you want to do that? Just do
mainWindow.loadURL('') and let me know if it works.
And please read this


The reason is for the splash screen I have for the application which uses a CSS file unless you know how I can combine the main.js code to use that css than redirect to the the page? I will try that out without it and see how it goes.


The page still doesn’t load


You can use a BrowserWindow for splash screen and then load the main window using setTimeout maybe?

Oh dang.


I see the example on it using a message but how would I make that do a redirect instead or show a image first then redirect? also what should I do about this issue?


Try this:

mainWindow.loadURL('') // Load splash screen

setTimeout(function () {
}, 5000) // Load store page after 5 secs


How could I set it to load just the index.html file instead but remove the redirect in the code or just use the CSS for the splash for it?

EDIT don’t worry figured it out, now to fix this rendering bug…


Which version of electron are you on? Have you tried different versions? Maybe it’s a bug.


The latest version 1.6.2, I have tried it many times in the past on older versions and it still has this issue.


I peeked in the console and there was a lot of errors logged, maybe it’s a problem with Wix.


Hmm yeah it might be, I got a question how do I set the size of a new window that opens like for example if I clicked on a link and it opens a window the window will be in I assume 800x600 but I would like to change that window size for all new windows opened


The link would probably load in the same BrowserWindow it was clicked in, Listen to will-navigate and new-window events and open the link in a new BrowserWindow


So if I added

myBrowserWindow.webContents.on(‘new-window’, (event, url) => {
const win = new BrowserWindow({show: false})
win.once(‘ready-to-show’, () =>
event.newGuest = win

it will set the new window size to the same size as the parent window?


I’m not sure, probably not. Use .getSize() to get the parent window size and set the size of the child window to that.

EDIT: So the code would be:

myBrowserWindow.webContents.on('new-window', (event, url) => {
  let pSize = myBrowserWindow.getSize()
  const win = new BrowserWindow({show: false, width: pSize[0], height: pSize[1]})
  win.once('ready-to-show', () =>
  event.newGuest = win

I haven’t tried it, it should work but if it doesn’t let me know


Where exactly do I place this snippet of code?


Try pasting that after your createWindow() function


I don’t have createWindow() function in my code

var app = require(‘electron’).app
var BrowserWindow = require(‘electron’).BrowserWindow
// Report crashes to our server.

// Keep a global reference of the window object, if you don’t, the window will
// be closed automatically when the javascript object is GCed.
var mainWindow = null;

// Quit when all windows are closed.
app.on(‘window-all-closed’, function() {
if (process.platform != ‘darwin’)

// This method will be called when atom-shell has done everything
// initialization and ready for creating browser windows.
app.on(‘ready’, function() {
// In the main process.
const {BrowserWindow} = require(‘electron’)

mainWindow = new BrowserWindow({width: 1350, height: 900,icon: __dirname + ‘/node_modules/icon.png’});
mainWindow.loadURL(‘file://’ + __dirname + ‘/node_modules/index.html’); // Load splash screen

setTimeout(function () {
}, 3000) // Load store page after 5 secs
// Emitted when the window is closed.
mainWindow.on(‘closed’, function() {
// Remove mainWindow.on(‘closed’, function() { if you want the menu back
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null;

the code currently