mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-10 19:46:03 +00:00
Ladybird: Add a protocol to the URL, when one is not set
When a http(s):// is not written by the user - lets manually add one.
This commit is contained in:
parent
700c709c00
commit
2905bda0f2
Notes:
sideshowbarker
2024-07-17 09:37:30 +09:00
Author: https://github.com/elcuco
Commit: 2905bda0f2
Pull-request: https://github.com/SerenityOS/serenity/pull/16583
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/awesomekling ✅
Reviewed-by: https://github.com/linusg
2 changed files with 4 additions and 2 deletions
|
@ -73,8 +73,10 @@ Tab::Tab(QMainWindow* window)
|
|||
QObject::connect(focus_location_edit_action, &QAction::triggered, m_location_edit, &QLineEdit::selectAll);
|
||||
}
|
||||
|
||||
void Tab::navigate(QString const& url)
|
||||
void Tab::navigate(QString url)
|
||||
{
|
||||
if (!url.startsWith("http://", Qt::CaseInsensitive) && !url.startsWith("https://", Qt::CaseInsensitive))
|
||||
url = "http://" + url;
|
||||
view().load(url.toUtf8().data());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue