Merge pull request #8582 from howard-stearns/open-browser-and-close

Handle window.open/close in Web content.
This commit is contained in:
Brad Hefta-Gaub 2016-09-08 21:17:40 -07:00 committed by GitHub
commit ad8a832c86
2 changed files with 5 additions and 7 deletions

View file

@ -1,6 +1,6 @@
import QtQuick 2.5
import QtQuick.Controls 1.2
import QtWebEngine 1.1
import QtWebEngine 1.2
import "controls-uit"
import "styles" as HifiStyles
@ -223,6 +223,9 @@ ScrollingWindow {
var newWindow = component.createObject(desktop);
request.openIn(newWindow.webView)
}
onWindowCloseRequested: {
root.destroy();
}
Component.onCompleted: {
desktop.initWebviewProfileHandlers(webview.profile)

View file

@ -15,7 +15,7 @@ WebEngineView {
id: root
property var newUrl;
profile.httpUserAgent: "Mozilla/5.0 Chrome/38.0 (HighFidelityInterface)"
profile: desktop.browserProfile
Component.onCompleted: {
console.log("Connecting JS messaging to Hifi Logging")
@ -60,9 +60,4 @@ WebEngineView {
}
}
}
// This breaks the webchannel used for passing messages. Fixed in Qt 5.6
// See https://bugreports.qt.io/browse/QTBUG-49521
//profile: desktop.browserProfile
}