Search code examples
cocoawebviewmouseeventtransparentclick-through

How to click-through on transparent parts of cocoa web view


Okay so I have a web view that holds the chat bar div from Facebook.com. The web view itself is larger/taller than the bar because obviously it needs to be for when a chat box is opened. When a chat box isn't open though, that area of the web view is transparent. I need the transparent areas of the web view to ignore mouse events and send them to whatever is behind.

How should I go about this?


Solution

  • Subclass the WebView and implement your own hitTest: method.