nw.js
nw.js copied to clipboard
NW.js window object returning incorrect DOM window object with new_instance / mixed_context options on
Issue Type
- [x] Bug Report
- [x] Successfully reproduced against the latest version of NW.js?
Current/Missing Behavior
Consider the following snippet:
nw.Window.open('https://www.google.com', {
// new_instance: true,
// mixed_context: true
}, (win) => {
chrome.developerPrivate.openDevTools({
renderViewId: -1,
renderProcessId: -1,
extensionId: chrome.runtime.id
});
console.log(win.window.location.href);
});
console.log outputs: https://www.google.com
On the other hand, this snippet:
nw.Window.open('https://www.google.com', {
new_instance: true,
mixed_context: true
}, (win) => {
chrome.developerPrivate.openDevTools({
renderViewId: -1,
renderProcessId: -1,
extensionId: chrome.runtime.id
});
console.log(win.window.location.href);
});
console.log outputs: chrome-extension://angoeahjodghadolndhmaahccpfijbnc/_generated_background_page.html
Expected/Proposed Behavior
Both console.log outputs should be https://www.google.com.
Additional Info
From what I could gather, mainFrameId in win.cWindow.tab[0] is wrong (it always points to 1).
- Operating System: macOS, Linux
- NW.js Version: 0.67.1
Hello guys, any comments on this issue: it's a bit pressing for us and we can even discuss a bounty. Thanks.
It works for me with latest v0.73.0