Commit Graph

51 Commits

Author SHA1 Message Date
Federico Guerinoni
17e9db4fa1 Ladybird: Add setting for page to open on new tab 2023-02-03 05:10:51 -07:00
Karol Kosek
f3c6510b83 Ladybird: Accept file drops 2023-01-19 19:22:03 +00:00
Karol Kosek
731fec525e Ladybird: Add URL and 'open in background' parameters to new_tab()
This will avoid loading starting about:blank page in places when we know
exactly what we want to load.

The opening in background part might be useful for future things like
file drops and right-click open in new tab.
2023-01-19 19:22:03 +00: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
Andreas Kling
2eaebdea5b Ladybird: Add Ctrl+= as an alternate "zoom in" shortcut
On many keyboards, Ctrl++ is actually Ctrl+Shift+=, and Ctrl+= makes
more sense as it's symmetric with Ctrl+-.

Both Firefox and Chrome already support this alternate shortcut,
so let's be nice and support it in Ladybird as well. :^)
2023-01-12 19:05:07 +00:00
Andreas Kling
c8ea23a4fe Ladybird: Use QKeySequence::StandardKey as much as possible
Let Qt pick the most appropriate native shortcut when it knows one.
2023-01-12 19:05:07 +00:00
Andreas Kling
9c7e26b8d4 Ladybird: Add "Copy" and "Select All" actions to the Edit menu 2023-01-12 19:55:10 +01:00
Linus Groh
966d808135 Ladybird: Replace ColorScheme enum with Web::CSS::PreferredColorScheme
This matches OutOfProcessWebView::set_preferred_color_scheme().
2023-01-12 18:27:34 +00:00
Linus Groh
0cc151bc1c Ladybird: Implement zoom :^) 2023-01-12 15:14:09 +00: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
Timothy Flynn
2cb3ae132a Ladybird: Implement SQLServer for Ladybird :^)
This adds a SQLServer binary for Ladybird to make use of Serenity's SQL
implementation. This has to use the same IPC socket handling that was
used to make WebContent and WebDriver work out-of-process.

Unlike Serenity, Ladybird creates a new SQLServer instance for each
Ladybird instance. In the future, we should try to make sure there is
only one SQLServer instance at a time, and allow multiple Ladybird
instances to communicate with it.
2022-12-25 07:58:58 -07:00
Timothy Flynn
a0cd260410 Ladybird: Do not domain match on cookie updates
This matches a corresponding change to Serenity's Browser.
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
Idan Horowitz
fad3fbfe26 Ladybird: Add block pop-ups checkbox to debug menu 2022-12-25 07:58:58 -07:00
Timothy Flynn
948c4ba102 Ladybird/WebDriver: Implement the cookie endpoints for Ladybird 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
Gunnar Beutner
acd70f44c2 Ladybird: Don't change window icons when background tabs change icons 2022-12-25 07:58:58 -07:00
Gunnar Beutner
5f3b82dcba Ladybird: Don't update window titles when background tabs change titles
Steps to reproduce:
1. Open the Cookie Clicker game in a tab.
2. Open another website in another tab and make that the current tab.
3. Observe how the window's title mentions Cookie Clicker.
2022-12-25 07:58:58 -07:00
Andreas Kling
8b593c9884 Ladybird: Add Ctrl+Shift+G shortcut to force a garbage collection 2022-12-25 07:58:58 -07:00
Andreas Kling
71dadabfaa Ladybird: Hook up the CookieJar again after WebContent introduction 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
742c4767df Ladybird/BrowserWindow: Make "View Source" a separate window
View Source was a subwindow which made it cover part of the browser with
no way for closing it.
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
Idan Horowitz
bf26b52ac6 Ladybird/BrowserWindow: Port user agent spoofing from Browser 2022-12-25 07:58:58 -07:00
Idan Horowitz
edd1e770d9 Ladybird/BrowserWindow: Give color scheme action group a detailed name
'group' is not very specific.
2022-12-25 07:58:58 -07:00
Andreas Kling
5ac5fef468 Ladybird: Add a very simple DOM inspector
We use a ModelTranslator to expose a DOMTreeModel from LibWebView :^)
It allows you to select the currently inspected node, which causes
the engine to render a little box model overlay above the web content.
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
eecee7369f Ladybird: Clean up tab bar autohide
Qt has this feature built-in, so there's no need to create a custom
implementation
2022-12-25 07:58:58 -07:00
Andreas Kling
97964bc710 Ladybird/BrowserWindow: Add UI for switching preferred CSS color scheme 2022-12-25 07:58:58 -07:00
Timothy Flynn
4850a2d272 Ladybird: Update pointer to current tab when the selected tab changes
This allows requests like dumping the DOM tree to be forwarded to the
correct tab. Otherwise, the event would be forwarded to the most
recently created tab.
2022-12-25 07:58:58 -07:00
Andreas Kling
0f1644f62d Ladybird: Switch to next/previous tab with Ctrl+PageDown/PageUp 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
aa27112d78 Ladybird: Tweak the QTabWidget look 2022-12-25 07:58:58 -07:00
Andreas Kling
37d844fd66 Ladybird: Use only the Qt event loop to speed everything up :^)
This patch removes the dual-event-loop setup, leaving only the Qt event
loop. We teach LibWeb how to drive Qt by installing an EventLoopPlugin.

This removes the 50ms latency on all UI interactions (and network
requests, etc.)
2022-12-25 07:58:58 -07:00
Filiph Sandström
91e5b6d4f5 Ladybird: Add SettingsDialog stub 2022-12-25 07:58:58 -07:00
Alec Murphy
700c709c00 Ladybird: Add Ctrl-W action to close current tab (#28) 2022-12-25 07:58:58 -07:00
Andreas Kling
aa5f886128 Ladybird: Add quick & dirty port of the JS console from Browser :^) 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
Filiph Sandström
ea7e637b6e Ladybird: Fix title branding when switching tabs 2022-12-25 07:58:58 -07:00
Filiph Sandström
ace44dc13b Ladybird: Hide TabBar if count <= 1 2022-12-25 07:58:58 -07:00
Andreas Kling
74c71804c7 Ladybird: Add "View Source" menu action (Ctrl+U) 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
303fda074a Ladybird: Fix build with Qt 6.2.4 2022-12-25 07:58:58 -07:00
Matthew Costa
67ab6dd2e6 Ladybird: Allow browser tabs to be closed
This is a small patch which wires up the tab close button.
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
Andreas Kling
69d264828f Ladybird: Add a "Reload" action to reload the current URL 2022-12-25 07:58:58 -07:00
Matthew Costa
7bf3010185 Ladybird: Trigger browser to quit when the main window is closed
This patch adds an event handler to the main window which allows it to
respond to a user closing the window. This event is then passed on to
the LibCore event loop, which allows the application quit itself.
Previously the application would hang, only running in the background,
until killed by an external force.
2022-12-25 07:58:58 -07:00
Keir Davis
95e3e06a1e Ladybird: Add Favicon to the window 2022-12-25 07:58:58 -07:00
Andreas Kling
da19b78dea Ladybird: Don't set a fixed height on the location edit 2022-12-25 07:58:58 -07:00
Andreas Kling
f5d033b8ba Ladybird: Show the web page title in the window titlebar :^) 2022-12-25 07:58:58 -07:00