diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-04-13 20:06:58 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-04-13 21:06:23 +0530 |
| commit | 0d9aedc087f56a3da35b6abc8a0ee233c2d2483b (patch) | |
| tree | 533bb26e33358f601ac37eb12a897ba13d046667 /src/widgets/BrowserWindow.cpp | |
| parent | bbe50215cbb9078ba457f93a5e90096e844c611a (diff) | |
| download | null-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.cpp | 7 |
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 |
