question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

some Window events won't fire if you open remote url

See original GitHub issue

NWJS Version : nwjs-sdk-v0.40.0-win-x64 Operating System : Windows 7

Expected behavior

Events like resize, move or loaded of Window should be emitted on all windows every time the event happens.

Actual behavior

Events are emitted only in window with local file (like test.html). Events aren’t emitted if you open remote url (like http://example.com).

How to reproduce

main.js

nw.Window.open('test.html', {}, function(win) {
	win.on("resize", function(w, h) {
		win.window.console.log("w, h",  w, h);
	});
});


nw.Window.open('http://example.com', {}, function(win) {
	win.on("resize", function(w, h) {
		win.window.console.log("w, h",  w, h);
	});
});

test.html

test

package.json

{
  "name": "eventstest",
  "main": "main.js"
}

The Window with test.html emits the resize event every time you resize it. The Window with http://example.com doesn’t. Same behavior can be observed with some other events.

For example the loaded event was working fire in version nwjs-sdk-v0.37.4-win-ia32, but it’s emitted only sometimes in windows with remote url and nwjs-sdk-v0.40.0-win-x64.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rogerwangcommented, Jan 6, 2020

Good to know that. Closing this issue for now and please file a new one of the window object issue.

0reactions
hrocha1commented, Mar 6, 2020

@rogerwang

It looks like that there are still some issues with the “close” event on windows with remote url. I’m having a problem receiving the “close” event under the NW2 mode (it works if I use --disable-features=nw2).

The breaking point is the 0.42.4 version where the NW2 mode has been introduced. Should I create a new issue for this problem?

Files to reproduce this issue:

issue9.zip

closing both windows should produce a message in the log.txt, but it only does for the local file

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to Access Event Viewer on a Remote Computer FIX ...
Unable to Access Event Viewer on a Remote Computer FIX [2022] If you are unable to access Event Viewer on a remote computer...
Read more >
SP2013 Remote Event Receivers won't fire in on-premises ...
I have been trying for nearly a week now to get a remote list item event receiver to fire in SP2013. I have...
Read more >
JavaScript event window.onload not triggered - Stack Overflow
In my case, I've used dynamic HTML, populating inside document via win = window.open("about:blank","",""); win.document.write(htmlcontent); . But my javascript ...
Read more >
How to resolve common problems with Windows Remote ...
This troubleshooting guide aims to help in ruling out some of the most common causes for poor functionality.
Read more >
How To Handle DOM and Window Events with React
In JavaScript apps using the React front-end library, you can use ... To demonstrate this, you will start by making your validating input....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found