mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +00:00
Ladybird: Assume file:// URL when URL starts with '/'
Allowing for easily pasting into ladybird the path to some HTML file (as an example). This behavior matches chrome and firefox handling.
This commit is contained in:
parent
83345ba698
commit
484635651c
1 changed files with 3 additions and 1 deletions
|
@ -468,7 +468,9 @@ void Tab::focus_location_editor()
|
||||||
|
|
||||||
void Tab::navigate(QString url, LoadType load_type)
|
void Tab::navigate(QString url, LoadType load_type)
|
||||||
{
|
{
|
||||||
if (!url.startsWith("http://", Qt::CaseInsensitive) && !url.startsWith("https://", Qt::CaseInsensitive) && !url.startsWith("file://", Qt::CaseInsensitive) && !url.startsWith("about:", Qt::CaseInsensitive))
|
if (url.startsWith("/"))
|
||||||
|
url = "file://" + url;
|
||||||
|
else if (!url.startsWith("http://", Qt::CaseInsensitive) && !url.startsWith("https://", Qt::CaseInsensitive) && !url.startsWith("file://", Qt::CaseInsensitive) && !url.startsWith("about:", Qt::CaseInsensitive))
|
||||||
url = "https://" + url;
|
url = "https://" + url;
|
||||||
m_is_history_navigation = (load_type == LoadType::HistoryNavigation);
|
m_is_history_navigation = (load_type == LoadType::HistoryNavigation);
|
||||||
view().load(ak_deprecated_string_from_qstring(url));
|
view().load(ak_deprecated_string_from_qstring(url));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue