Cocoa NSWebView, editable and paste

I recently had a problem with an editable webview in my application. The paste or cmd-v was correctly working for a text/plain or text/html clipboardData, but copying an URL from the browser top bar, and pasting it in the webview was not working at all (nothing at all is appearing). Here is how I did: 1. set your webView editable:  [myWebView setEditable:YES]; 2. load your html in the webView: [[myWebView mainFrame] loadHTMLString:yourhtml baseURL:nil]; (yourhtml is your html code …) 3. set the onpaste handler: when the html is really loaded, use this delegate: -(void)webView:(WebView...

read more