Navigating to a link that opens in a new tab not working in WebKitGtk WebView (original) (raw)
December 13, 2023, 2:13pm 1
Hello,
I have an application in C++, GTK 3.0, using WebKitGtk-2.4.1 I am struggling to implement a feature because it seems like whenever I try to navigate to a tab that opens in a new tab (naturally on a normal web browser), it just does absolutely nothing.
I have tried creating a callback to log the navigation event for when I use a button/link that opens a new tab but it doesnt log anything. The buttons that actually work get logged in my callback but I see absolutely nothing when I click a link that opens in a new tab. I am guessing that if the webpage is designed to open a new tab, I have to have some measures in place to handle that in my code for my web view.
I have attempted to read the docs but nothing really makes it clear how to handle this case (maybe Im just blind lol). So now I am here. Can anyone point me in the right direction on how to handle this and how to make it so I can navigate through links that open new tabs? And I guess it should be known that I am only assuming that it has to do with the new tab thing. Perhaps it is because of a different issue but the buttons only seem to become non-functional when they open new tabs.
Thanks.
mcatanzaro (Michael Catanzaro) December 13, 2023, 2:41pm 2
Hi, you need to implement the WebKitWebView::create
signal to create a new web view that’s related to the original web view. Follow the instructions provided by the documentation of that signal: you want to only create the web view at first, not also show it.
system (system) Closed January 12, 2024, 2:42pm 3
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.