mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 23:36:41 +02:00
Take in account current WebEngine profile to make sure all features are in place, like download
This commit is contained in:
parent
17a923b9de
commit
08deba35ae
1 changed files with 10 additions and 2 deletions
|
@ -13,6 +13,7 @@ Item {
|
||||||
property alias canGoBack: _webview.canGoBack
|
property alias canGoBack: _webview.canGoBack
|
||||||
property alias webViewCore: _webview
|
property alias webViewCore: _webview
|
||||||
property alias webViewCoreProfile: _webview.profile
|
property alias webViewCoreProfile: _webview.profile
|
||||||
|
property string webViewCoreUserAgent
|
||||||
|
|
||||||
property string userScriptUrl: ""
|
property string userScriptUrl: ""
|
||||||
property string urlTag: "noDownload=false";
|
property string urlTag: "noDownload=false";
|
||||||
|
@ -31,6 +32,7 @@ Item {
|
||||||
|
|
||||||
// Required to support clicking on "hifi://" links
|
// Required to support clicking on "hifi://" links
|
||||||
var url = loadRequest.url.toString();
|
var url = loadRequest.url.toString();
|
||||||
|
url = (url.indexOf("?") >= 0) ? url + urlTag : url + "?" + urlTag;
|
||||||
if (urlHandler.canHandleUrl(url)) {
|
if (urlHandler.canHandleUrl(url)) {
|
||||||
if (urlHandler.handleUrl(url)) {
|
if (urlHandler.handleUrl(url)) {
|
||||||
_webview.stop();
|
_webview.stop();
|
||||||
|
@ -53,6 +55,9 @@ Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
profile: HFWebEngineProfile;
|
profile: HFWebEngineProfile;
|
||||||
|
settings.pluginsEnabled: true
|
||||||
|
settings.touchIconsEnabled: true
|
||||||
|
settings.allowRunningInsecureContent: true
|
||||||
|
|
||||||
// creates a global EventBridge object.
|
// creates a global EventBridge object.
|
||||||
WebEngineScript {
|
WebEngineScript {
|
||||||
|
@ -89,8 +94,11 @@ Item {
|
||||||
_webview.javaScriptConsoleMessage.connect(function(level, message, lineNumber, sourceID) {
|
_webview.javaScriptConsoleMessage.connect(function(level, message, lineNumber, sourceID) {
|
||||||
console.log("Web Entity JS message: " + sourceID + " " + lineNumber + " " + message);
|
console.log("Web Entity JS message: " + sourceID + " " + lineNumber + " " + message);
|
||||||
});
|
});
|
||||||
_webview.profile.httpUserAgent = "Mozilla/5.0 Chrome (HighFidelityInterface)";
|
if (webViewCoreUserAgent !== undefined) {
|
||||||
|
_webview.profile.httpUserAgent = webViewCoreUserAgent
|
||||||
|
} else {
|
||||||
|
_webview.profile.httpUserAgent += " (HighFidelityInterface)";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onFeaturePermissionRequested: {
|
onFeaturePermissionRequested: {
|
||||||
|
|
Loading…
Reference in a new issue