Unable to load bundled WebKit plugins under 10.8 Mountain Lion

Originator:starkos
Number:rdar://11900695 Date Originated:7/18/2012
Status:Open Resolved:
Product:OS X Product Version:10.8
Classification:Bug Reproducible:Always
 
18-Jul-2012 08:40 AM Jason Perkins:
Summary:
My application uses an embedded WebView. The content shown in the WebView requires a plugin, which I distribute as part of my application bundle, in the Contents/Plugins folder. Under the 10.7 Lion sandbox, using the temporary mach-lookup exception for com.apple.WebKit.PluginAgent, this works fine. Under 10.8 Mountain Lion, the plugin is reported as available, but never loads. This is the same behavior I would see on 10.7 if I tried to run without the mach-lookup exception.

Steps to Reproduce:
- Create a Cocoa application

- Drag a WebView into the window

- Load a site which requires a plugin into the WebView. Pandora Radio needs Flash; it should fail to load.

   NSURL* url = [NSURL URLWithString:@"http://pandora.com"];
   NSURLRequest* req = [NSURLRequest requestWithURL:url];
   [[_webView mainFrame] loadRequest:req];

- Add a Copy Files build step to copy the (Flash, in this case) plugin to the bundle's Plugins folder.

- Try to run it again

Expected Results:
The website should load successfully, just as it would if the plugin was installed system-wide.

Actual Results:
The website will try to load (because WebKit reports the plugin as available) and then eventually fail when the plugin never loads.

Regression:
Plugins in the bundle's Contents/Plugins folder used to be found and loaded automatically.

Notes:
Running the same app as 32-bit works around the problem, presumably by never involving WebKit.PluginAgent.

Summary:
WebKit plugins placed in an application bundle's Contents/Plugins folder should be found and loaded automatically by WebKit.PluginAgent in Mountain Lion.

31-Jul-2012 10:16 AM Jason Perkins:
There is some feedback on the Apple forums that indicates that this might be the desired behavior, for sandboxing reasons: https://devforums.apple.com/message/703128

My "mental model" was that the bundled plugin would run within the same sandbox as the WebKit host, with the same permissions. Alternatively (and perhaps better), the plugin would run within its own sandbox (which would be great for system-wide plugins in /Library/Internet Plug-Ins). 

At the least, a sandbox violation should be reported to the Console when trying to load a plugin from the application bundle. And the plugin should not be reported as available to WebKit.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!