Android lets you add a Javascript Interface, that will let you use “window.interfacename.myfunction()” to call a function in the Java program.
Is there any similar feature that allows a PyGTK with embedded webkit browser to have similar functionality, to call a specific Python function from Javascript?
I ended up adding a handler for special urls. I overrode the webkit with:
where self.webkitGo is the name of the function:
def webkitGo(self, view, frame, net_req, nav_act, pol_dec):In this function, you can receive the url data from
net_req.get_uri()and decide what to do with it, and return true to not do the default behavior.