Skip to content

Conversation

@hdijkema
Copy link
Contributor

Fix problems with navigation events that aren't generated by GtkWebKit.
(used lib: libwebkit2gtk-4.1-0 on linux Mint).

The WebKit engine to apparently doesn't catch the navigations and does not produce navigation events, when something like "webui_bind(_webui_win, "", webui_event_handler);" is called. Although this should be expected behaviour.

By implementing a handler for the GtkWebKit decision signal, this navigation event can still be generated.

(used lib: libwebkit2gtk-4.1-0 on linux Mint).

The WebKit engine to apparently doesn't catch the navigations and does not produce navigation events, when something like "webui_bind(_webui_win, "", webui_event_handler);" is called. Although this should be expected behaviour.

By implementing a handler for the GtkWebKit decision signal, this navigation event can still be generated.

Signed-off-by: Hans Dijkema <[email protected]>
@hdijkema
Copy link
Contributor Author

There are some fails that do not seem to be related to the changes of this pull request.

@AlbertShown AlbertShown merged commit 1709ac8 into webui-dev:main Oct 20, 2025
6 of 24 checks passed
@AlbertShown
Copy link
Member

There are some fails that do not seem to be related to the changes of this pull request.

Yes, this is a Windows workflow fails to find TLS, this because GitHub added Windows Server 2025. I will try to fix it.

@AlbertShown
Copy link
Member

@hdijkema I noticed that catching events now have two different functions, one is the regular webui_bind() with empty string, and the other ones are those added in your recent PRs. To not force all wrappers to be updated, and to not force to update all documentation, I will try to redirect those WebView event to the regular one, so no wrappers and documentation will need to be updated.

@hdijkema
Copy link
Contributor Author

@hdijkema I noticed that catching events now have two different functions, one is the regular webui_bind() with empty string, and the other ones are those added in your recent PRs. To not force all wrappers to be updated, and to not force to update all documentation, I will try to redirect those WebView event to the regular one, so no wrappers and documentation will need to be updated.

I'm curious how you want to do that. Oh I see. You can of course catch this in the regulare webui_bind() with an empty string. Great. good Idea I think.

@AlbertShown
Copy link
Member

I'm curious how you want to do that

I will use your own GTK code to catch event and sends it to webui_bind(), then will be blocked by default. Then user can use webui_navigate() API to perform the navigation. The goal is the same exact code that work for web browser should work also for WebView.

@AlbertShown
Copy link
Member

There are some fails that do not seem to be related to the changes of this pull request.

Fixed in 63fb9fc

@hdijkema hdijkema deleted the gtkwebkit-navigation branch October 21, 2025 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants