Webview : contentWindow not available at this time
Webview tag creation and appending is successful, but only mode of communication with webview is postMessaging. in such case contentWindow is not available.
snippet:
var _webview = document.createElement('webview');
_webview.src = "http://google.com";
document.body.appendChild(_webview);
console.log( _webview.contentWindow );
expected : contentWindow of webview source behavior : "ContentWindow is not available at this time"
But the source frame is completely loaded. onload is triggered properly. take a look at the attached screenshot

Added to it: Worked in nwjs : 0.12.0-alpha1 Not working in nwjs : 0.12.0-alpha3
Hi @rogerwang
Thanks , for working on this issue, Fix works great. Just thought of asking your views on this, How we can debug or inspect things withing webview. Do we have way to show them in DevTools as how the iframe are shown with host/document.title names in Chrom Dev Tools.
Cheers !!!
@kamesh-a devtools works differently. each webview have it's own dedicated devtool.
supposing your devtools port is 9222: package.json
"chromium-args": "--remote-debugging-port=9222"
Go to http://localhost:9222/json to get the list of windows and webviews and their associated devtools frontend url.
Then open it in chrome or nwjs (it should looks like http://localhost:9222/devtools/inspector.html?ws=localhost:9229/devtools/page/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)
@felicienfrancois got it !! thank you :+1:
@rogerwang i was experimenting sending a postMessage to contentWindow, it seems contentWindow is not pointing to the actual document.
my postMessages are not reaching webviews contentWindow. Strange this noticed:
Expected Behaviour : _webview.contentWindow.document = it own src, Document Current Behaviour: _webview.contentWindow.document == points to Whole HTML document which was used for embedding webview
this makes me thing the message which i am posting contentWindow is going to someOther window. so window object is not pointing to src of webview (.i.e, in example http://google.com )

You can witness the hover of whole document. Can you please open the issue. Do let me know if you need any info or queries regarding this.
@felicienfrancois
Need to mention that package.json is not the only way to activate remote debugger, you can just add --remote-debugging-port=9222 to nw command line.