0
我想玩nwjs,我無法弄清楚如何調試。如何訪問nwjs應用程序的控制檯輸出?
require('nw.gui').Window.get().showDevTools()
var menu = new nw.Menu();
menu.append(new nw.MenuItem({
label: 'Item A',
click: function(){
alert('You have clicked at "Item A"');
}
}));
menu.append(new nw.MenuItem({ label: 'Item B' }));
menu.append(new nw.MenuItem({ type: 'separator' }));
menu.append(new nw.MenuItem({ label: 'Item C' }));
document.body.addEventListener('contextmenu', function(ev) {
console.log("Hello");
ev.preventDefault();
menu.popup(ev.x, ev.y);
return false;
}, false);
我加了兩行代碼:
require('nw.gui').Window.get().showDevTools();
console.log("Hello");
我運行一個腳本,看到兩個窗口:
我的教程有基本的腳本如果我右鍵單擊文字,使顯示的菜單,但不在調試工具欄中輸出。
我在做什麼錯?
請參閱[「應該問題包括」標籤「在他們的標題?」](http://meta.stackexchange.com/questions/19190/should-questions-include-tags-in - 他們的標題),其中共識是「不,他們不應該」! –
是特定於Windows 10,還是[tag:nwjs]? –
特定於nwjs – kevas