How to add a Webkit plugin to my OS X WebView sandboxed application?

I am new to developing OS X applications, so bear with me ..... I have an OS X application that makes extensive use of WebView to provide the user with a video conferencing / screenshot function that relies on a browser plugin. The video plugin works when my sandbox is disabled, but we would like to distribute our application in the App Store for OS X and we need to make it work with an isolated WebView.

My question is, how can I enable the sandbox and have an isolated WebView web browser with a browser plugin? Is it possible to associate a plugin with an application and initialize WebView with the plugin enabled? Is there an example of this somewhere in the Apple developer docs or somewhere in Interwebs?

+1
source share
1 answer

The simple answer is: run as 32-bit.

Longer answer: in 10.7 you can load plugins (from the folder with the content / plugins folder) in the sandbox if you add a temporary mach-lookup exception for com.apple.WebKit.PluginAgent and it works like 32- 64-bit binaries. In 10.8, when it runs as 64-bit, the plugin is reported as available, but will never load, and nothing is written to the console to indicate the reason (or something went wrong). Presumably, the plugin agent does not have permissions for the sandbox to start the plugin process and does not work. When launched in 32-bit mode, the plugin starts in the process, in accordance with the rights to the isolated host application environment.

I gave Apple error # 11900695 to report this back in July 2012, asking either to make it work, or to tell the plugin as unavailable and register something. At this moment it is still open.

Hope this helps!

+2
source

Source: https://habr.com/ru/post/1441313/


All Articles