From 0d9aedc087f56a3da35b6abc8a0ee233c2d2483b Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 13 Apr 2025 20:06:58 +0530 Subject: Add downloads_dir configuration + auto-accept download requests --- src/widgets/BrowserWindow.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/widgets/BrowserWindow.cpp') diff --git a/src/widgets/BrowserWindow.cpp b/src/widgets/BrowserWindow.cpp index dbefdd6..5a8a062 100644 --- a/src/widgets/BrowserWindow.cpp +++ b/src/widgets/BrowserWindow.cpp @@ -21,8 +21,13 @@ BrowserWindow::BrowserWindow(const Configuration &configuration, const QStringLi layout->setStackingMode(QStackedLayout::StackAll); centralWidget()->setLayout(layout); + // Webengine profile + auto *profile = new QWebEngineProfile("null-browser"); + profile->setDownloadPath(configuration.downloads_dir()); + profile->setHttpUserAgent(configuration.user_agent()); + // Web engine - auto *webview_stack = new WebViewStack(&configuration, new QWebEngineProfile("null-browser")); + auto *webview_stack = new WebViewStack(&configuration, profile); layout->addWidget(webview_stack); // Open webviews for given urls -- cgit v1.3.1