Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

With WebKit GTK, how do I open a link in an external browser?

Tags:

python

webkit

gtk

I am writing an application using the GTK implementation of WebKit and Python. In my app I render some links but when the user clicks the link in my WebKit view it loads the linked page inside the webkit view. I instead want the link to open in the system's default web browser.

Any idea?

like image 767
Jono Bacon Avatar asked Dec 03 '25 16:12

Jono Bacon


1 Answers

First you want to intercept when the user clicks on any link rendered by webkit. See navigation-policy-decision-requested.

Second you want to reject that request and make a request to the host OS to open the requested link using the default browser. For that you can see this issue as a starting point.

like image 146
holygeek Avatar answered Dec 06 '25 10:12

holygeek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!