如何将Webkit插件添加到沙盒OS X应用程序WebView? [英] How do I add a Webkit plugin to my sandboxed OS X app WebView?

查看:111
本文介绍了如何将Webkit插件添加到沙盒OS X应用程序WebView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是OS X应用程序开发的新手,所以请耐心.....我有一个OS X应用程序,该应用程序广泛使用WebView为用户提供视频会议/屏幕共享功能,该功能依赖于浏览器插件。当我禁用沙箱功能时,该视频插件可以工作,但是我们希望在OS X App Store中分发我们的应用,并需要使其与沙箱WebView一起使用。



<我的问题是,如何启用沙盒并使我的沙盒WebView包含浏览器插件?我可以将插件与应用程序捆绑在一起,并使用附带的插件初始化WebView吗?

解决方案

简单的答案:以32-运行



更长的答案:在10.7上,您可以在沙箱中加载捆绑的插件(从捆绑包的Content / Plugins文件夹中加载),前提是您要为其添加临时的mach查找例外com.apple.WebKit.PluginAgent,这对32位和64位二进制文​​件均有效。在10.8上,当以64位运行时,该插件被报告为可用,但将永远不会加载,并且不会在控制台上记录任何内容以指示原因(或发生任何错误)。大概是插件代理缺少沙盒启动插件过程的权限,并且无提示地失败。当以32位运行时,该插件将在宿主应用程序沙箱权利下在进程内运行。



我在2012年7月提交了Apple Bug#11900695进行报告。 ,要求使其工作或将插件报告为不可用并记录一些内容。



希望有帮助!


I'm new to OS X application development, so bear with me.....I've got an OS X application that extensively uses a WebView to provide the user with a video conference/screensharing feature which relies on a browser plugin. The video plugin works when I have sandboxing disabled, but we'd like to distribute our app in the OS X App Store and need to get it to work with a sandboxed WebView.

My question is, how can I enable sandboxing and have my sandboxed WebView include the browser plugin? Can I bundle the plugin with the app and initialize the WebView with the plugin included? Is there an example of this somewhere in the Apple developer docs or somewhere on the Interwebs?

解决方案

Simple answer: run as 32-bit.

Longer answer: On 10.7, you can load bundled plugins (from your bundle's Content/Plugins folder) within the sandbox provided you add a temporary mach-lookup exception for com.apple.WebKit.PluginAgent, and this works on both 32- and 64-bit binaries. On 10.8, when run as 64-bit, the plugin is reported as available, but will never load, and nothing is logged to the console to indicate the cause (or that anything has gone wrong). Presumably the plugin agent lacks sandbox permissions to start the plugin process and fails silently. When run in 32-bit, the plugin is run in-process, under the host applications sandbox entitlements.

I filed Apple bug #11900695 to report this back in July 2012, requesting to either make it work, or report the plugin as unavailable and log something. At this point it is still open.

Hope that helps!

这篇关于如何将Webkit插件添加到沙盒OS X应用程序WebView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆