Skip to content

Commit e7d034b

Browse files
mnuttclaude
andcommitted
Qt: Fix URL bar lag during back/forward navigation
The URL bar was showing the previous URL instead of updating immediately during back/forward navigation. This was caused by coreFrameUrl() returning the current document URL instead of the target navigation URL. Fix by checking if there's an active document loader with a different URL and returning that target URL instead. This ensures the URL bar updates synchronously with back/forward navigation. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 97d3e9b commit e7d034b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Source/WebKitLegacy/qt/WebCoreSupport/QWebFrameAdapter.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,13 @@ void QWebFrameAdapter::renderCompositedLayers(WebCore::GraphicsContext& context,
446446
// FIXME: this might not be necessary, but for the sake of not breaking things, we'll use that for now.
447447
QUrl QWebFrameAdapter::coreFrameUrl() const
448448
{
449+
// For back/forward navigation, use the target URL if available
450+
if (auto* activeLoader = frame->loader().activeDocumentLoader()) {
451+
const URL& targetUrl = activeLoader->url();
452+
if (!targetUrl.isEmpty() && targetUrl != frame->document()->url()) {
453+
return targetUrl;
454+
}
455+
}
449456
return frame->document()->url();
450457
}
451458

0 commit comments

Comments
 (0)