From 6cbeac50922b72e6d6783c531611eafc95f4c91a Mon Sep 17 00:00:00 2001 From: Szabolcs David Date: Thu, 5 Mar 2015 05:07:04 -0800 Subject: Support middle click navigation When the user does a middle click on a link which originally opens a new tab (target="_blank"), the newly created RenderView is hidden, so the new tab has no visible content. We need to unhide it explicitly. This also adds background tab support for the Quick example browsers and fixes the profile mismatching warning in the case when we adopt a new tab without WebContents. Change-Id: Ia3c2e752a4784d32133cee0ff278c2849b151582 Reviewed-by: Allan Sandfeld Jensen --- tests/quicktestbrowser/BrowserWindow.qml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests/quicktestbrowser') diff --git a/tests/quicktestbrowser/BrowserWindow.qml b/tests/quicktestbrowser/BrowserWindow.qml index 45fad8d9c..e173080dd 100644 --- a/tests/quicktestbrowser/BrowserWindow.qml +++ b/tests/quicktestbrowser/BrowserWindow.qml @@ -128,6 +128,7 @@ ApplicationWindow { shortcut: "Ctrl+T" onTriggered: { tabs.createEmptyTab() + tabs.currentIndex = tabs.count - 1 addressBar.forceActiveFocus(); addressBar.selectAll(); } @@ -299,7 +300,7 @@ ApplicationWindow { function createEmptyTab() { var tab = addTab("", tabComponent) // We must do this first to make sure that tab.active gets set so that tab.item gets instantiated immediately. - tabs.currentIndex = tabs.count - 1 + tab.active = true tab.title = Qt.binding(function() { return tab.item.title }) return tab } @@ -374,6 +375,10 @@ ApplicationWindow { if (!request.userInitiated) print("Warning: Blocked a popup window.") else if (request.destination == WebEngineView.NewViewInTab) { + var tab = tabs.createEmptyTab() + tabs.currentIndex = tabs.count - 1 + request.openIn(tab.item.webView) + } else if (request.destination == WebEngineView.NewViewInBackgroundTab) { var tab = tabs.createEmptyTab() request.openIn(tab.item.webView) } else if (request.destination == WebEngineView.NewViewInDialog) { -- cgit v1.2.3