我将 youtube 视频嵌入到 node-webkit无框架应用程序中,每当单击视频中的 youtube 链接时,预期的行为是在默认浏览器中打开 url,但它所做的是创建一个新的 node-webkit无框架我的应用程序顶部的窗口。iv'e 尝试覆盖 window.open 但这无济于事,因为 flash 可能使用其他一些 api 来启动新窗口,我正在寻找一种完全禁用新窗口或能够随时拦截的方法打开一个新窗口并将 url 重定向到默认浏览器。我查看了api,似乎javascript没有暴露给具有所有窗口实例的浏览器进程。
关于如何解决这个问题的任何想法?
编辑:好的,所以有一种方法可以禁用闪存调用navigateToURL
它是您添加到您的参数:<param name="allowNetworking" value="internal"/>
虽然不理想,但这有助于用户体验。来源: http://livedocs.adobe.com/flex/3/html/help.html?content= wrapper_13.html
第二次编辑:我发现的另一个错误是第二个弹出窗口完全崩溃了 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)