nw.js: some Window events won't fire if you open remote url
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.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (7 by maintainers)
Commits related to this issue
- Fix event handling on remote pages Ref nwjs/nw.js#7125 — committed to nwjs/chromium.src by rogerwang 5 years ago
- Fix native hidden binding Ref nwjs/nw.js#7125 — committed to nwjs/chromium.src by rogerwang 5 years ago
Good to know that. Closing this issue for now and please file a new one of the window object issue.