mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 17:49:40 +00:00
UI/AppKit: Do not rely on the implicit URL constructors
This commit is contained in:
parent
097f7fe169
commit
0f495421f1
Notes:
github-actions[bot]
2025-03-04 21:26:12 +00:00
Author: https://github.com/shannonbooth
Commit: 0f495421f1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3668
Reviewed-by: https://github.com/trflynn89
2 changed files with 9 additions and 3 deletions
|
@ -9,6 +9,7 @@
|
|||
#include <Interface/LadybirdWebViewBridge.h>
|
||||
#include <LibGfx/ImageFormats/PNGWriter.h>
|
||||
#include <LibGfx/ShareableBitmap.h>
|
||||
#include <LibURL/Parser.h>
|
||||
#include <LibURL/URL.h>
|
||||
#include <LibWeb/HTML/SelectedFile.h>
|
||||
#include <LibWebView/Application.h>
|
||||
|
@ -1138,8 +1139,10 @@ static void copy_data_to_clipboard(StringView data, NSPasteboardType pasteboard_
|
|||
{
|
||||
auto* delegate = (ApplicationDelegate*)[NSApp delegate];
|
||||
|
||||
auto url = MUST(String::formatted([delegate searchEngine].query_url, URL::percent_encode(*m_context_menu_search_text)));
|
||||
[self.observer onCreateNewTab:url activateTab:Web::HTML::ActivateTab::Yes];
|
||||
auto url_string = MUST(String::formatted([delegate searchEngine].query_url, URL::percent_encode(*m_context_menu_search_text)));
|
||||
auto url = URL::Parser::basic_parse(url_string);
|
||||
VERIFY(url.has_value());
|
||||
[self.observer onCreateNewTab:url.release_value() activateTab:Web::HTML::ActivateTab::Yes];
|
||||
}
|
||||
|
||||
- (void)takeVisibleScreenshot:(id)sender
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue