fix: disable file:// browsing
This commit is contained in:
parent
69035176d5
commit
3e1a1c9ca9
|
@ -545,10 +545,12 @@ Rectangle {
|
||||||
} else if (request.destination === WebEngineView.NewViewInBackgroundTab) {
|
} else if (request.destination === WebEngineView.NewViewInBackgroundTab) {
|
||||||
var backgroundTab = tabs.createEmptyTab(currentWebView.profile);
|
var backgroundTab = tabs.createEmptyTab(currentWebView.profile);
|
||||||
request.openIn(backgroundTab.item);
|
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();
|
var dialog = browserDialogComponent.createObject();
|
||||||
dialog.currentWebView.profile = currentWebView.profile;
|
dialog.currentWebView.profile = currentWebView.profile;
|
||||||
request.openIn(dialog.currentWebView);
|
dialog.currentWebView.webChannel = channel;
|
||||||
|
request.openIn(dialog.currentWebView);*/
|
||||||
} else {
|
} else {
|
||||||
// Instead of opening a new window, we open a new tab
|
// Instead of opening a new window, we open a new tab
|
||||||
// TODO: remove "open in new window" from context menu
|
// TODO: remove "open in new window" from context menu
|
||||||
|
@ -611,6 +613,13 @@ Rectangle {
|
||||||
findBar.reset();
|
findBar.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onNavigationRequested: {
|
||||||
|
if(request.url.toString().startsWith("file://")){
|
||||||
|
console.log("Local file browsing is disabled" )
|
||||||
|
request.action = WebEngineNavigationRequest.IgnoreRequest;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
active: webEngineView.url.toString() === "status://downloads"
|
active: webEngineView.url.toString() === "status://downloads"
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
Loading…
Reference in New Issue