开发者

How do I detect when a safari webplugin loses focus?

开发者 https://www.devze.com 2023-01-13 06:08 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消