0

I'm having difficulty in using a WebView that is being used purely to display a preview of a website - and I want to ignore all/any interactions the user may try to make with it.

I've already tried Cocoa webView - Disable all interaction to no avail; you can still easily spam-click and it will recognise the presses. (at least there's no context menu)

This one seems overkill; Disable a WebKit WebView - there must be an easier way.

In iOS I know exactly how to solve this, but as a Cocoa newcomer I am stumped - does anyone have any suggestions or better ways to achieve this? Or dump a transparent NSView on top and gobble up interactions? (tried this as well by subclassing an NSView, also to no effect)

Whole project is in IB currently, if this makes any difference.

4

1 回答 1

1

我想你想实现一个WebPolicy 委托并让它拒绝导航事件。

于 2012-12-16T16:03:40.763 回答