trodi / electron-splashscreen

Simple splashscreen for electron applications.
MIT License
170 stars 29 forks source link

Electron 3.0 not working #16

Closed do-web closed 6 years ago

trodi commented 6 years ago

@do-web , I just ran the 2 examples in this project against electron v3.0.0 successfully. If you are running into an issue, please provide details on what's wrong and how to reproduce.

do-web commented 6 years ago

With the fallowing config the splashscreen apears but not hide, and the main window do not show.

const config = {
        windowOpts: {
            width: windowState.width,
            height: windowState.height,
            x: windowState.x,
            y: windowState.y,
            minWidth: 800,
            minHeight: 720,
            maximized: true,
            show: false,
            icon:
                process.platform === 'win32'
                    ? `${__dirname}/icons/icon.ico`
                    : process.platform === 'darwin' ? `${__dirname}/icons/icon.icns` : `${__dirname}/icons/icon.png`,
            titleBarStyle: process.platform === 'darwin' ? 'hidden' : null,
            frame: process.platform !== 'darwin',
            webPreferences: {
                webSecurity: false,
                devTools: isDevelopment
            }
        },
        delay: 0,
        templateUrl: path.join(__dirname, 'splash.html'),
        minVisible: 4000,
        splashScreenOpts: {
            width: 600,
            height: 400,
            backgroundColor: "white",
        },
    };

With electron 2.0 this works fine.

trodi commented 6 years ago

Modifying the project's example to use your options and running on macOS, I still don't run into any issues. The splash-screen listens for your main BrowserWindow's "did-finish-load" event before hiding. Of course, your code must still call loadURL on the main window that is returned from initSplashScreen.

Does your main window load if you remove the call to electron-splashscreen? If not, then the issue is not with electron-splashscreen. Also, it appears that maximized is not a valid property in electron v3.0.0, maybe you meant maximizable.

trodi commented 6 years ago

Closing due to inactivity. If you have more information, you can re-open.