Fix for navigation with GtkWebKit, more in line with bind(<win>, "", <callback>). - #656
Fix for navigation with GtkWebKit, more in line with bind(<win>, "", <callback>).#656hdijkema wants to merge 2 commits into
Conversation
will also catch the navigation event for GtkWebKit (linux WebView). So no need anymore for an navigation handler, unless one would want to implement this as a feature for all webview / browser variants. Signed-off-by: Hans Dijkema <hans@dijkewijk.nl>
Signed-off-by: Hans Dijkema <hans@dijkewijk.nl>
|
I did it in a different way (13a9d5a). |
Hi AlbertShown, I've reviewed your code. No need for testing yet I'm afraid, because you're missing one point: When one sets new content manually (with some show form), be it HTML or a URL or a file, GtkWebKit will also generate a decide-policy signal. If its going to be ignored, the content will not be set, but the page will be cleared and the connection to the GtkWebKit window will be lost (i.e. no webui.js loaded). So you can´t always ignore the policy signal. Sometimes you must allow it. You can also not reliable trust the navigation_type to be So a lot of corners and bends to be considered when catching this behaviour. If you look at my solution, you can see that whenever something is shown programmatically, a flag is set, which is reset in the navigation handler. This ensures that GtkWebKit loads the provided HTML/Url/File as one would expect when one sets the content explicitly. |
|
If you want, I can take your current work and work on it to get it working the way it should. Would that be a good idea? |
|
I've added some changes to your code to make it work. Closing this pull request. |
Yes of course, that will be great, and thank you for that. |
I've finished this change. See pull request #659. |
With this code change, the call to bind(, "", ),
will also catch the navigation event for GtkWebKit (linux WebView).
So no need anymore for an navigation handler, unless one would
want to implement this as a feature for all webview / browser variants.