GithubHelp home page GithubHelp logo

WindowState.manage(win) makes BrowserWindow.loadURL() reject promise in electron 5.0.0+ (using 5.0.1)) about electron-window-state HOT 4 CLOSED

mawie81 avatar mawie81 commented on June 5, 2024
WindowState.manage(win) makes BrowserWindow.loadURL() reject promise in electron 5.0.0+ (using 5.0.1))

from electron-window-state.

Comments (4)

mawie81 avatar mawie81 commented on June 5, 2024

I cant reproduce this. Do you have a sample where this happens?
My minimal test:

const { app, BrowserWindow } = require('electron');
const windowStateKeeper = require('electron-window-state');
let win;

function createWindow() {
  let mainWindowState = windowStateKeeper({
    defaultWidth: 1000,
    defaultHeight: 800,
  });

  // Create the browser window.
  win = new BrowserWindow({
    x: mainWindowState.x,
    y: mainWindowState.y,
    width: mainWindowState.width,
    height: mainWindowState.height,
  });

  win
    .loadURL('https://google.com')
    .then(() => console.log('resolve'))
    .catch(e => console.error(e));

  mainWindowState.manage(win);
}

app.on('ready', createWindow);

from electron-window-state.

mithom avatar mithom commented on June 5, 2024

let me try to reproduce it as well in a minimal setting, my code base isnt big yet, so maybe you can check it in there if you want with the public repository (let me first clean up the code quickly)

from electron-window-state.

mithom avatar mithom commented on June 5, 2024

for now this is the code, i didn't have time for the minimal version yet:
https://github.com/mithom/streamerbuddy/blob/feature/auto-update/main.js

this is the error stacktrace:
http://prntscr.com/npjdxn

{ Error: ERR_ABORTED (-3) loading 'http://localhost:50298/'
at rejectAndCleanup (C:\Users\AIR41604\Desktop\Thomas Michiels\streamer-buddy\node_modules\electron\dist\resources\electron.asar\browser\navigation-controller.js:72:21)
at WebContents.navigationListener (C:\Users\AIR41604\Desktop\Thomas Michiels\streamer-buddy\node_modules\electron\dist\resources\electron.asar\browser\navigation-controller.js:93:20)
at WebContents.emit (events.js:194:13)
at WebContents.EventEmitter.emit (domain.js:469:20)
at WebContents.topLevelDomainCallback (domain.js:124:23)

errno: -3,
code: 'ERR_ABORTED',
url: 'http://localhost:50298/' }

from electron-window-state.

mithom avatar mithom commented on June 5, 2024

i should have tested this before making this issue, but with google it indeed works fine.
I will investigate my issue more, but for now i wouldn't say it is electron-window-state causing causing it anymore. My appologies for looking in the wrong place (initially the error disappeared when i commented the .manage(win) out, but now even that doesn't work)

from electron-window-state.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.