I have created my view (wrapped in a window) and loaded an URL like this:
self.web_view = WebKit2.WebView()
self.web_view.load_uri("https://en.wikipedia.org")
My "Mini-Browser" starts and I can click on local links (links which are bound to JavaScript events or links to other pages on the same domain). But when the links point to other domains, nothing happens. How do I catch clicks on external links? Or how can I open these links in the system default browser?
UPDATE: Cross site links are not handled by the "Mini-Browser". Can I write an event hook(onclick) to interrupt the "Mini-Browser" and act based on custom logic or is there a way to configure cross-site links.
Did you use a GtkLinkButton ? According to the doc of gtk-show-uri which uses the default-browser to open links, you additionally need to install the gvfs to get support for uri schemes such as http://
or ftp://
For debian based distributions you can install gvfs just like that:
sudo apt-get install gvfs gvfs-backends gvfs-fuse
If that does not help, you additionally can check the error-message of gtk_show_uri
, in case it returns FALSE
For custom-browsers, like yours, according to the doc of GtkLinkButton you need to connect to the activate-link signal and return true from the handler ... probably you already did so.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With