Giter Club home page Giter Club logo

Comments (5)

karnthis avatar karnthis commented on August 30, 2024 2

I know this is an old issue, just wanted to leave a note for others that might have the issue. loadURL() is the wrong method to be using in this situation. Before a window is open()ed, setURL() is used to define the window url if it is not done as part of createNew(). loadURL() is done after open(). Example code:

var win2 = windowManager.createNew('win2', 'Windows #2');
win2.setURL('https://www.facebook.com');
win2.open();
win2.loadURL('https://www.google.com');

from electron-window-manager.

tamkeen-tms avatar tamkeen-tms commented on August 30, 2024 1

Hi there

I am not sure, it's been awhile since I last updated (or used) this library, or Electron for that matter. Try to debug more and If you find a solution please make PR.

Good luck

from electron-window-manager.

pascallieverse avatar pascallieverse commented on August 30, 2024

Hey I got the same issue,

Started a clean electron-quick-start-master on windows 10, and added the following code to to the index.html:

` var remote = require('electron').remote;
var windowManager = remote.require('electron-window-manager');

// Create a new window
var win2 = windowManager.createNew('win23', 'Windows #2');
win2.loadURL('/test.html');
win2.open();`

This gives the same error as above mentioned. (used different urls, like direct file, http and https)

I tried to find where the index.js of the electron-window-manager crashes, this happens on line 303:
instance.content().loadURL(url, options);
Before this line everything runs, after that line it doesn't.

from electron-window-manager.

pascallieverse avatar pascallieverse commented on August 30, 2024

Code works when you define the url in the createNew function:
var win2 = windowManager.createNew('win2', 'Windows #2', "http://example.com", false, {}, false); win2.open();

I cant debug further because I cant find something that has to do with content().
Instance just returns the saved window data.

Confirmed that line 303 works fine when loadURL function is not directly called.

from electron-window-manager.

a-sync avatar a-sync commented on August 30, 2024

It's also hinted in the README.md, just under setURL :)

... to open a URL after the window is open use loadURL().

-- I just noticed that the readme has an example using loadURL instead of setURL while the description of loadURL is also not very clear :-/

from electron-window-manager.

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.