Warning, /maui/fiery/src/views/browser/Browser.qml is written in an unsupported language. File is not indexed.
0001 import QtQuick 2.14 0002 import QtQml 2.12 0003 import QtQuick.Controls 2.13 0004 import QtQuick.Layouts 1.3 0005 0006 import QtWebEngine 1.10 0007 import org.mauikit.controls 1.3 as Maui 0008 import org.maui.fiery 1.0 as Fiery 0009 0010 import "../home" 0011 0012 Maui.SplitViewItem 0013 { 0014 id: control 0015 property alias url : _webView.url 0016 property alias webView : _webView 0017 readonly property string title : _webView.title.length ? _webView.title : "Fiery" 0018 readonly property string iconName: _webView.icon 0019 0020 height: ListView.view.height 0021 width: ListView.view.width 0022 0023 Maui.TabViewInfo.tabTitle: title 0024 Maui.TabViewInfo.tabToolTipText: _webView.url 0025 0026 ActionsMenu 0027 { 0028 id: _menu 0029 webView: _webView 0030 } 0031 0032 WebEngineView 0033 { 0034 id: _webView 0035 0036 anchors.fill: parent 0037 0038 profile: root.profile 0039 zoomFactor: appSettings.zoomFactor 0040 0041 backgroundColor: Maui.Theme.backgroundColor 0042 0043 onContextMenuRequested: { 0044 request.accepted = true // Make sure QtWebEngine doesn't show its own context menu. 0045 _menu.request = request 0046 _menu.show() 0047 0048 // _menu.show() 0049 } 0050 0051 onLoadingChanged: 0052 { 0053 if(loadRequest.status === WebEngineView.LoadSucceededStatus) 0054 { 0055 Fiery.History.appendUrl(control.url, control.title, control.iconName) 0056 } 0057 } 0058 0059 onIconChanged: { 0060 console.log("ICON CHANGED", icon) 0061 if (icon) 0062 { 0063 Fiery.History.updateIcon(url, icon) 0064 } 0065 } 0066 0067 onLinkHovered: 0068 { 0069 console.log("LINK HOVERED", url) 0070 } 0071 0072 onFindTextFinished: { 0073 // findInPageResultIndex = result.activeMatch; 0074 // findInPageResultCount = result.numberOfMatches; 0075 } 0076 0077 onFileDialogRequested: 0078 { 0079 console.log("FILE DIALOG REQUESTED", request.mode, FileDialogRequest.FileModeSave) 0080 0081 } 0082 0083 onNewViewRequested: 0084 { 0085 if(!request.userInitiated) 0086 return; 0087 0088 var newWindow = windowComponent.createObject(root) 0089 request.openIn(newWindow.webView); 0090 } 0091 0092 onNavigationRequested: 0093 { 0094 console.log("Navigation requested", request.navigationType) 0095 } 0096 0097 settings.accelerated2dCanvasEnabled : appSettings.accelerated2dCanvasEnabled 0098 settings.allowGeolocationOnInsecureOrigins : appSettings.allowGeolocationOnInsecureOrigins 0099 settings.allowRunningInsecureContent : appSettings.allowRunningInsecureContent 0100 settings.allowWindowActivationFromJavaScript : appSettings.allowWindowActivationFromJavaScript 0101 settings.autoLoadImages : appSettings.autoLoadImages 0102 settings.dnsPrefetchEnabled : appSettings.dnsPrefetchEnabled 0103 settings.hyperlinkAuditingEnabled : appSettings.hyperlinkAuditingEnabled 0104 settings.javascriptCanAccessClipboard : appSettings.javascriptCanAccessClipboard 0105 settings.javascriptCanOpenWindows : appSettings.javascriptCanOpenWindows 0106 settings.javascriptCanPaste : appSettings.javascriptCanPaste 0107 settings.javascriptEnabled : appSettings.javascriptEnabled 0108 settings.linksIncludedInFocusChain : appSettings.linksIncludedInFocusChain 0109 settings.localContentCanAccessFileUrls : appSettings.localContentCanAccessFileUrls 0110 settings.localContentCanAccessRemoteUrls : appSettings.localContentCanAccessRemoteUrls 0111 settings.localStorageEnabled : appSettings.localStorageEnabled 0112 settings.pdfViewerEnabled : appSettings.pdfViewerEnabled 0113 settings.playbackRequiresUserGesture : appSettings.playbackRequiresUserGesture 0114 settings.pluginsEnabled : appSettings.pluginsEnabled 0115 settings.webGLEnabled : appSettings.webGLEnabled 0116 settings. webRTCPublicInterfacesOnly : appSettings.webRTCPublicInterfacesOnly 0117 } 0118 0119 Maui.Holder 0120 { 0121 anchors.fill: parent 0122 visible: control.url.toString().length <= 0 || _webView.status === WebEngineView.LoadFailedStatus 0123 emoji: "qrc:/internet.svg" 0124 0125 title: _webView.status === WebEngineView.LoadFailedStatus ? i18n("Error") : i18n("Start Browsing") 0126 body: i18n("Enter a new URL or open a recent site.") 0127 } 0128 0129 Component.onCompleted: 0130 { 0131 if(!control.url || !control.url.length || !validURL(control.url)) 0132 { 0133 // _stackView.push(_startComponent) 0134 } 0135 } 0136 } 0137 0138