summaryrefslogtreecommitdiff
path: root/Userland/Applications/Help
diff options
context:
space:
mode:
authorLucas CHOLLET <lucas.chollet@free.fr>2022-05-13 00:18:30 +0200
committerLinus Groh <mail@linusgroh.de>2022-06-27 20:22:15 +0100
commit0c2dc6be66e64591749a43dfa90751c5182cb800 (patch)
tree8cef5adc01edf7b02f611ecc12af293ba039ff33 /Userland/Applications/Help
parent662711fa26de109d4c8fe1d93f17e1983d66ebf3 (diff)
downloadserenity-0c2dc6be66e64591749a43dfa90751c5182cb800.zip
Help: Use LibWeb to open files via RequestServer
Diffstat (limited to 'Userland/Applications/Help')
-rw-r--r--Userland/Applications/Help/MainWidget.cpp17
-rw-r--r--Userland/Applications/Help/main.cpp1
2 files changed, 2 insertions, 16 deletions
diff --git a/Userland/Applications/Help/MainWidget.cpp b/Userland/Applications/Help/MainWidget.cpp
index c294076456..97e534b838 100644
--- a/Userland/Applications/Help/MainWidget.cpp
+++ b/Userland/Applications/Help/MainWidget.cpp
@@ -267,22 +267,7 @@ ErrorOr<void> MainWidget::initialize_fallibles(GUI::Window& window)
void MainWidget::open_url(URL const& url)
{
if (url.protocol() == "file") {
- auto path = url.path();
- auto source_result = m_manual_model->page_view(path);
- if (source_result.is_error()) {
- GUI::MessageBox::show(window(), String::formatted("{}", source_result.error()), "Failed to open man page", GUI::MessageBox::Type::Error);
- return;
- }
-
- auto source = source_result.value();
- String html;
- {
- auto md_document = Markdown::Document::parse(source);
- VERIFY(md_document);
- html = md_document->render_to_html();
- }
-
- m_web_view->load_html(html, url);
+ m_web_view->load(url);
m_web_view->scroll_to_top();
GUI::Application::the()->deferred_invoke([&, path = url.path()] {
diff --git a/Userland/Applications/Help/main.cpp b/Userland/Applications/Help/main.cpp
index 4a2e781b0e..c3838dee50 100644
--- a/Userland/Applications/Help/main.cpp
+++ b/Userland/Applications/Help/main.cpp
@@ -33,6 +33,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::unveil("/res", "r"));
TRY(Core::System::unveil("/usr/share/man", "r"));
+ TRY(Core::System::unveil("/tmp/portal/filesystemaccess", "rw"));
TRY(Core::System::unveil("/tmp/portal/launch", "rw"));
TRY(Core::System::unveil("/tmp/portal/webcontent", "rw"));
TRY(Core::System::unveil(nullptr, nullptr));