aboutsummaryrefslogtreecommitdiff
path: root/src/widgets/BrowserWindow.cpp
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-04-13 20:06:58 +0530
committerAkshay Nair <phenax5@gmail.com>2025-04-13 21:06:23 +0530
commit0d9aedc087f56a3da35b6abc8a0ee233c2d2483b (patch)
tree533bb26e33358f601ac37eb12a897ba13d046667 /src/widgets/BrowserWindow.cpp
parentbbe50215cbb9078ba457f93a5e90096e844c611a (diff)
downloadnull-browser-0d9aedc087f56a3da35b6abc8a0ee233c2d2483b.tar.gz
null-browser-0d9aedc087f56a3da35b6abc8a0ee233c2d2483b.zip
Add downloads_dir configuration + auto-accept download requests
Diffstat (limited to '')
-rw-r--r--src/widgets/BrowserWindow.cpp7
1 files changed, 6 insertions, 1 deletions
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