Context menu for HtmlViewer

How do I handle the context menu for a HtmlViewer? Some items don’t make sense when used as email viewer like “Open link in new window”. Others like “Download image” I would like to handle.

WebUIDelegateMBS has been deprecated for a while.

I would say you have to handle them with javascript …

I’m lazy. I’d like to use the MBS plugin.

In my case, I use a bit of javascript to suppress it.

Well, if you use WKWebViewControlMBS, you can use the willShowContextualMenu event:

event willShowContextualMenu(menu as NSMenuMBS, NSEvent as NSEventMBS)

And there you can edit the menu before showing it.

I saw this event. But then I have to switch to WKWebview first. But I suppose that this is the best solution.