File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Userland/Applications/Browser Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 23
23
#include < Applications/Browser/TabGML.h>
24
24
#include < Applications/BrowserSettings/Defaults.h>
25
25
#include < LibConfig/Client.h>
26
+ #include < LibFileSystem/FileSystem.h>
26
27
#include < LibGUI/Action.h>
27
28
#include < LibGUI/Application.h>
28
29
#include < LibGUI/BoxLayout.h>
@@ -702,6 +703,14 @@ void Tab::update_reset_zoom_button()
702
703
Optional<URL> Tab::url_from_location_bar (MayAppendTLD may_append_tld)
703
704
{
704
705
DeprecatedString text = m_location_box->text ();
706
+ if (text.starts_with (' /' ) && FileSystem::is_regular_file (text)) {
707
+ auto real_path = FileSystem::real_path (text);
708
+ if (real_path.is_error ()) {
709
+ return {};
710
+ }
711
+
712
+ return URL::create_with_file_scheme (real_path.value ().to_deprecated_string ());
713
+ }
705
714
706
715
StringBuilder builder;
707
716
builder.append (text);
You can’t perform that action at this time.
0 commit comments