Commit Graph

40 Commits

Author SHA1 Message Date
Cameron Youell
b97f9f5809 Ladybird: Make LocationEdit its own class
Also make return key behave more like other browsers when editing
2023-01-22 21:15:22 -07:00
Karol Kosek
194ddca24f Ladybird: Move the initial blank page load to BrowserWindow
Takes care of a FIXME :^)
2023-01-19 19:22:03 +00:00
Karol Kosek
5e89773937 Ladybird: Don't prepend 'about:' urls with an http:// scheme 2023-01-19 19:22:03 +00:00
Karol Kosek
4f36893fda Ladybird: Set initial page when NOT connected to WebDriver
This flips an if check condition, making the JS console work in new tabs
again.
2023-01-19 19:22:03 +00:00
Andreas Kling
f476b827de Ladybird: Let Qt pick the reload shortcut
This fixes an issue on platforms where Ctrl+R is the preferred native
shortcut, and we were effectively trying to set it twice.
2023-01-09 17:32:00 +01:00
Karol Kosek
01a786310d Ladybird: Add Qt's standard refresh key (F5) to reload shortcuts 2023-01-08 19:38:35 +01:00
Timothy Flynn
e5192073d9 Ladybird/WebDriver: Move to using local socket files for WebDriver IPC
This allows us to use standard Serenity IPC infrastructure rather than
manually creating FD-passing sockets. This also lets us use Serenity's
WebDriver Session class, removing the copy previously used in Ladybird.
This ensures any changes to Session in the future will be picked up by
Ladybird for free.
2022-12-25 07:58:58 -07:00
Linus Groh
5a5c4f079b Ladybird: Update for AK::{String => DeprecatedString} rename 2022-12-25 07:58:58 -07:00
Baitinq
97dd5a085f Ladybird: Replace history entry if loading URL because of a redirect
We now replace the current history entry if the page-load has been
caused because of a redirect. This makes it able to traverse the
history if one of the entries redirects you, which previously
caused an infinite history traversion loop.

Depends on https://github.com/SerenityOS/serenity/pull/16004
2022-12-25 07:58:58 -07:00
Timothy Flynn
54321f49ad Ladybird: Implement WebDriver's navigation and window control endpoints 2022-12-25 07:58:58 -07:00
Timothy Flynn
4031630b49 Ladybird: Construct a WebDriverConnection when instructed to do so
The WebDriver will pass the --webdriver-fd-passing-socket command line
option when it launches Ladybird. Forward this flag onto the WebContent
process, where it will create the WebDriverConnection for IPC.
2022-12-25 07:58:58 -07:00
Baitinq
e80147afba Ladybird: Fix reloading functionality
Previously, reloading went back to the first page loaded by
WebView::load() or WebView::load_html(), as they are the only methods
that modify m_url, which is what the reload loaded. Now we handle
reloads in Tab.cpp by simply loading the last entry in the m_history.
2022-12-25 07:58:58 -07:00
Baitinq
15e4d151c3 Ladybird: Don't add initial about:blank load to history
The hackish initial loading of about:blank was previously added to the
history, so you could go back to it (which wasn't very ergonomic). Now
we set the m_is_history_navigation flag before loading it so it doesn't
get added to the history.
2022-12-25 07:58:58 -07:00
Baitinq
eaff4a1d65 Ladybird: Don't push to history when loading through history navigation
Previously we were always pushing to history on the on_load_start
callback. Now we only do that if we are NOT navigating through the
history navigation (loading pages by going back/forward). This is what
the SerenityOS browser does:^)
2022-12-25 07:58:58 -07:00
Baitinq
982174706b Ladybird: Handle forward and backward mouse buttons
We now emit a new signal for backward mouse button's mouseup and forward
mouse button's mouseup which is handled by going back and forward in the
history respectively:))
2022-12-25 07:58:58 -07:00
Linus Groh
11b730fccb Ladybird: Use Browser's History.{cpp,h}
There are no custom changes for Ladybird in the current copies of those
files, so we just need to ensure to keep Ladybird up to date for any
changes made upstream.
2022-12-25 07:58:58 -07:00
Andreas Kling
0a8c86a9d9 Ladybird: Load about:blank in new tabs
This makes the JS console usable in new tabs, without having to load
something first.
2022-12-25 07:58:58 -07:00
Andreas Kling
26a7ea0e0f Ladybird: Render web content in a separate process :^)
This patch brings over the WebContent process over from SerenityOS
to Ladybird, along with a new WebContentView widget that renders
web content in a separate process.

There's a lot of jank and FIXME material here, notably I had to re-add
manually pumped Core::EventLoop instances on both sides, in order to get
the IPC protocol running. This introduces a lot of latency and we should
work towards replacing those loops with improved abstractions.

The WebContent process is built separately here (not part of Lagom) and
we provide our own main.cpp for it. Like everything, this can be better
architected, it's just a starting point. :^)
2022-12-25 07:58:58 -07:00
Moustafa Raafat
22c3b8be7b Ladybird/Tab: Handle "Dump History" action 2022-12-25 07:58:58 -07:00
Moustafa Raafat
9854feb263 Ladybird/Tab: Update history title when tab title changes 2022-12-25 07:58:58 -07:00
Andrew Kaster
2ff37d7e13 Ladybird/Everywhere: Ensure that Qt objects are created with parents
This prevents memory leaks detected by both Valgrind and ASAN/LSAN.

Valgrind is still suspicious of the leaked JS::VM from
Web::Bindings::main_thread_vm() but there's other issues with leak
checking all the GC'd objects.

Co-Authored-By: Diego Iastrubni <diegoiast@gmail.com>
2022-12-25 07:58:58 -07:00
Andreas Kling
2a021084e5 Ladybird: Rename WebView to SimpleWebView
This will allow us to share code with LibWebView from SerenityOS.
(This would otherwise not work, since its "WebView" namespace collides
with our "WebView" class.)

Also, we should eventually move towards a more sophisticated
multi-process WebView like OOPWV.
2022-12-25 07:58:58 -07:00
Aaron Dewes
bdce860ac5 Ladybird: Make Tab.cpp directly take a BrowserWindows as m_window 2022-12-25 07:58:58 -07:00
Julen Ruiz Aizpuru
98bf0107ce Ladybird/Tab: Conditionally enable back/forward buttons 2022-12-25 07:58:58 -07:00
Julen Ruiz Aizpuru
ea3e9a3102 Ladybird/Tab: Make back/forward keyboard shortcuts platform-specific
This commit changes how we set the back and forward button key bindings
to use platform-specific standard key sequences.

For example, in Mac OS X, the back action will be now triggered via
Cmd+← and Cmd+[, whereas previously the action was mapped to Alt+←,
which is not standard in Mac OS X.
2022-12-25 07:58:58 -07:00
Andreas Kling
27b9cd13ee Ladybird: Focus the location editor when creating a new tab
This lets you start typing a new URL right after pressing Ctrl+T.
2022-12-25 07:58:58 -07:00
Andreas Kling
031005de2d Ladybird: Remove some awkward camelCase signal names
We use snake_case for everything except when we're forced by Qt to use
their camelCase names.
2022-12-25 07:58:58 -07:00
Andreas Kling
0c4ae810d7 Ladybird: Hide the hovered URL label on startup 2022-12-25 07:58:58 -07:00
Andreas Kling
f4a9b382b1 Ladybird: Remove spacing between toolbar and web view 2022-12-25 07:58:58 -07:00
Andreas Kling
d74802e4e2 Ladybird: Show hovered link URLs in a conditional UI label
The tooltips for hovered links were super awkward when in a tooltip
2022-12-25 07:58:58 -07:00
Filiph Sandström
a838004725 Ladybird: Add Settings class 2022-12-25 07:58:58 -07:00
Andreas Kling
1b682e4b2c Ladybird: Don't rewrite file:// URLs to HTTP 2022-12-25 07:58:58 -07:00
Andreas Kling
c216e714c7 Ladybird: Tweak inaccurate copyright year :^) 2022-12-25 07:58:58 -07:00
Diego Iastrubni
2905bda0f2 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.
2022-12-25 07:58:58 -07:00
Daniel Bertalan
af5250b2cb Ladybird: Fix compilation on macOS/Clang
- Silences the -Wuser-defined-literals warning which is triggered by our
  use of the `sv` suffix for StringView
- Removes an unused captured `this` pointer [-Wunused-lambda-capture]
- Changes a JSONArray.h include to JSONObject.h to get the definition
  for `JSONValue::serialize`. This is needed because template functions
  are not exported for dylibs on macOS. This is a hack; the JSON headers
  should be refactored so that each one includes the definition of
  the template functions it sees. -- Maybe we should build with
  -fvisibility-inlines-hidden on Linux to catch issues like this?
2022-12-25 07:58:58 -07:00
Filiph Sandström
d1d6a204fc Ladybird: Replace StatusBar with ToolTip
This gives the actual webcontent more space to work with,
it also emulates how other browsers does it.

In the future we'd like to do something else since only ToolTip
can be visible at the same time.
2022-12-25 07:58:58 -07:00
Andreas Kling
487544d7b4 Ladybird: Port over part of the "Debug" menu from the SerenityOS browser
This is pretty messy, but we have to start somewhere. Eventually we
should find a way to share this code with SerenityOS.
2022-12-25 07:58:58 -07:00
Andreas Kling
50b3672f52 Ladybird: Add keyboard shortcut for focusing the location edit (Ctrl+L) 2022-12-25 07:58:58 -07:00
Matthew Costa
7681ef25da Ladybird: Expanded toolbar with browser history and home button
This patch takes the browser history code from the Serenity browser and
wires it up to the QT interface. This is tied in with a few extra
toolbar buttons associated with each tab.
2022-12-25 07:58:58 -07:00
Matthew Costa
8af5b49cba Ladybird: Rudimentary tabbed browsing support
This patch removes the browser WebView from the window and places it
inside a Tab object, all wrapped up in a QT tab control. So far you can
create tabs, but can't close them.
2022-12-25 07:58:58 -07:00