Handle window.open requests from web pages in WebView following QT upgrade.

Handle window.close requests in the browser.
This commit is contained in:
howard-stearns 2016-09-08 13:06:33 -07:00
parent a40a9f1d73
commit ebf280fd6f
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
}