控制在node-webkit中打开的闪存窗口

我将youtubevideoembedded到node-webkit 无框应用程序中,只要单击video中的youtube链接,预期的行为就是在默认浏览器中打开url,但它所做的是创build一个新的节点 – webkit frameless在我的应用程序顶部的窗口。 iv'e尝试覆盖window.open,但这并没有帮助,因为Flash可能使用一些其他API来启动一个新的窗口,我正在寻找的是一种方法来完全禁用新的窗口,或者为了能够拦截会打开一个新窗口并将URLredirect到默认浏览器。 我看了谷歌的API,似乎JavaScript不暴露在浏览器进程,其中包含所有的窗口实例。

任何想法如何解决这个问题?

编辑:好的,所以有一种方法来禁用Flash调用navigateToURL它是一个参数,你添加到: <param name="allowNetworking" value="internal"/> ,而不理想这有助于用户体验。 来源: http : //livedocs.adobe.com/flex/3/html/help.html?content=wrapper_13.html

第二编辑:我发现的另一个错误是第二个popup窗口崩溃node-webkit完全,这是控制台不输出任何有用的东西:

 2013-11-07 22:42:52.435 node-webkit[78145:507] Internals of CFAllocator not known; out-of-memory failures via CFAllocator will not result in termination. http://crbug.com/45650 2013-11-07 22:42:52.609 node-webkit Helper[78146:507] Internals of CFAllocator not known; out-of-memory failures via CFAllocator will not result in termination. http://crbug.com/45650 2013-11-07 22:42:52.803 node-webkit Helper EH[78147:507] Internals of CFAllocator not known; out-of-memory failures via CFAllocator will not result in termination. http://crbug.com/45650 2013-11-07 22:42:52.932 node-webkit Helper EH[78148:507] Internals of CFAllocator not known; out-of-memory failures via CFAllocator will not result in termination. http://crbug.com/45650 [78148:1107/224252:INFO:plugin_main_mac.mm(22)] No Carbon Interpose library found. 2013-11-07 22:42:53.103 node-webkit Helper[78149:507] Internals of CFAllocator not known; out-of-memory failures via CFAllocator will not result in termination. http://crbug.com/45650 [78145:1107/224253:INFO:simple_index_file.cc(397)] Simple Cache Index is being restored from disk. 2013-11-07 22:42:53.653 node-webkit Helper[78151:507] Internals of CFAllocator not known; out-of-memory failures via CFAllocator will not result in termination. http://crbug.com/45650 2013-11-07 22:42:54.036 node-webkit Helper EH[78148:507] CoreText performance note: Client called CTFontCreateWithName() using name "Arial Unicode MS" and got font with PostScript name "ArialUnicodeMS". For best performance, only use PostScript names when calling this API. 2013-11-07 22:42:54.036 node-webkit Helper EH[78148:507] CoreText performance note: Set a breakpoint on CTFontLogSuboptimalRequest to debug. 2013-11-07 22:42:54.519 node-webkit Helper EH[78148:507] CoreText performance note: Client called CTFontCreateWithName() using name "Times Roman" and got font with PostScript name "Times-Roman". For best performance, only use PostScript names when calling this API. [78145:1107/224258:INFO:CONSOLE(0)] "'KeyboardEvent.keyLocation'' is deprecated. Please use 'KeyboardEvent.location' instead.", source: (0) 

我已经尝试了许多变化,包括YouTube的推荐iFrameembedded方法,但根据https://developers.google.com/youtube/player_parameters上的文档,您无法完全摆脱YouTube链接&#x3002;

您可以做的最好的办法是隐藏大部分控件等,但在播放过程中,用户仍然可以select点击YouTube徽标并远离您的网站。

如果您在node-webkit应用程序中使用WebChimera ,则可以使用它与youtube链接进行连接,并将所需的button添加到工具栏(只需less量编程),然后将button单击事件发送给JS以告诉它该做什么。 (在你的情况下,用默认浏览器打开youtube链接)

WebChimera Player移植到Node-Webkit(embedded在应用中的WebChimera插件): https : //github.com/jaruba/WebChimeraPlayerNW

下载链接为Windows

对于Mac,Readme.md中提供了分步说明。