NPAPI plugins in 10.12.6 Beta 1

We have an NPAPI plugin that handles certain file downloads from our server application. Upon receipt of the downloaded file the plugin will then launch our application passing either a path to the file or the contents of the file in an Apple Event. After installing 10.12.6 Beta 1 we've noticed that our app gets launched but it seems that no Apple Events are passed. If we use LSOpenItemsWithRole passing the FSRef of the download file, the -application:openFiles: app delegate method is never called when the app is launched.


If I change the code to use -[NSWorkspace launchApplicationAtURL:options:configuration:error] and pass an event in NSWorkspaceLaunchCongurationAppleEvent, that event is not part of the initial open event either.


Is this expected or is it a bug?

I figured out what this is. A recent change in WebKit sets an environment variable __APPLEEVENTSERVICENAME to an emtpy string. (I tried to link to the specific change in Github but then my reply ended up in moderation that no one approved so I removed the link).


This has the effect of disabling support for Apple Events. However, since I'm launching another process from the WebKit process that has the variable set my process is inheriting that environment variable too. I'm able to fix this by changing my plugin to unset the variable prior to launching my app and then restoring it after. Ugly...

NPAPI plugins in 10.12.6 Beta 1
 
 
Q