fix: disable file:// browsing

This commit is contained in:
Richard Ramos 2020-12-02 11:48:04 -04:00 committed by Iuri Matias
parent 69035176d5
commit 3e1a1c9ca9
1 changed files with 11 additions and 2 deletions

View File

@ -545,10 +545,12 @@ Rectangle {
} else if (request.destination === WebEngineView.NewViewInBackgroundTab) {
var backgroundTab = tabs.createEmptyTab(currentWebView.profile);
request.openIn(backgroundTab.item);
} else if (request.destination === WebEngineView.NewViewInDialog) {
// Disablign popups temporarily since we need to set that webengineview settings / channel and other proeprties
/*} else if (request.destination === WebEngineView.NewViewInDialog) {
var dialog = browserDialogComponent.createObject();
dialog.currentWebView.profile = currentWebView.profile;
request.openIn(dialog.currentWebView);
dialog.currentWebView.webChannel = channel;
request.openIn(dialog.currentWebView);*/
} else {
// Instead of opening a new window, we open a new tab
// TODO: remove "open in new window" from context menu
@ -611,6 +613,13 @@ Rectangle {
findBar.reset();
}
onNavigationRequested: {
if(request.url.toString().startsWith("file://")){
console.log("Local file browsing is disabled" )
request.action = WebEngineNavigationRequest.IgnoreRequest;
}
}
Loader {
active: webEngineView.url.toString() === "status://downloads"
width: parent.width