[webkit-gtk] Custom paste handler for editable WebView

Robert Schroll rschroll at gmail.com
Mon Jul 28 14:55:35 PDT 2014

Does anyone have some pointers on this?

On Sat, Jul 19, 2014 at 5:46 PM, Robert Schroll <rschroll at gmail.com> 
> Hi all,
> Without any input from me, an editable WebView will paste text into 
> itself when I press Ctrl-V.  I don't know if this is handled entirely 
> within the WebView, or if the Gtk.Window contains a Ctrl-V 
> accelerator that sends a paste signal to the WebView.  Regardless, 
> I'd like to provide a custom handler for this paste event, rather 
> than relying on the default one.  Is this possible?
> It is for other Gtk widgets, I know.  For example, if I add this 
> handler to a Gtk.Entry:
> 	entry.connect('paste-clipboard', lambda *args:
> 		entry.stop_emission('paste-clipboard'))
> the paste doesn't happen.  (I could query the clipboard and insert 
> some text into the Entry myself, of course.)  But when I do that to a 
> WebView, it has no effect.  The documentation suggests that there is 
> a paste-clipboard signal for the WebView, and I can trigger it 
> manually.  How can I intercept it?
> Thanks,
> Robert

More information about the webkit-gtk mailing list