Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7e9ef30

Browse files
committed
allow clicked links in external nav windows to be opened in same window
1 parent 4dbea88 commit 7e9ef30

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/cpp/desktop/DesktopWebPage.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,15 +231,18 @@ bool WebPage::acceptNavigationRequest(QWebFrame* pWebFrame,
231231
{
232232
handleBase64Download(pWebFrame, url);
233233
}
234-
else if (navType == QWebPage::NavigationTypeLinkClicked)
235-
{
236-
desktop::openUrl(url);
237-
}
238234
else if (allowExternalNav_)
239235
{
236+
// if allowing external navigation, follow this (even if a link click)
240237
navigated_ = true;
241238
return true;
242239
}
240+
else if (navType == QWebPage::NavigationTypeLinkClicked)
241+
{
242+
// when not allowing external navigation, open an external browser
243+
// to view the URL
244+
desktop::openUrl(url);
245+
}
243246

244247
if (!navigated_)
245248
this->view()->window()->deleteLater();

0 commit comments

Comments
 (0)