Friday, June 24, 2022

Customize the Contextual Menu of a Mac WKWebView

Alexander Clauss:

Under iOS the WKWebView class provides a delegate method which allow to customize the contextual menu of the web engine (the menu which opens when long-pressing a link). Unfortunately under macOS the WKWebView does not provide such a method for its contextual menu. This article explains how you can customize the contextual menu of WKWebView under macOS as well. It’s not that obvious how to do this, but it can be done.

1 Comment RSS · Twitter


This is the wackiest technique ever, but it works. I don't think I would have ever thought of this idea if not for Alexander's blog post.

Leave a Comment