How do I detect when a safari webplugin loses focus?
I need to be able to detect the browser loses focus in a webkit plugin I wrote. I thought I could implement the webViewUnfocus method from the WebUIDelegate protocol but that's not firing. Does anyone have a pointer to a code snippet for what should be a relatively simple proble开发者_开发技巧m?
The solution to this problem was to setup an observer that watched for NSApplicationDidBecomeActiveNotification and NSApplicationDidResignActiveNotification notifications. This let me cleanup and reinitialize when the app lost and regained focus.
精彩评论