summaryrefslogtreecommitdiff
path: root/Userland/Utilities/headless-browser.cpp
AgeCommit message (Collapse)Author
2023-02-13Everywhere: Remove the `AK::` qualifier from Stream usagesTim Schumacher
2023-02-13LibCore: Remove `Stream.h`Tim Schumacher
2023-02-13LibCore: Move Stream-based file into the `Core` namespaceTim Schumacher
2023-02-13LibCore: Move Stream-based sockets into the `Core` namespaceTim Schumacher
2023-02-13LibCore: Rename `File` to `DeprecatedFile`Tim Schumacher
As usual, this removes many unused includes and moves used includes further down the chain.
2023-02-10Everywhere: Remove needless copies of Error / ErrorOr instancesTimothy Flynn
Either take the underlying objects with release_* methods or move() the instances around.
2023-02-08AK: Remove the fallible constructor from `FixedMemoryStream`Tim Schumacher
2023-02-02LibWeb+LibWebSocket: DOM WebSocket subprotocol supportGuilherme Gonçalves
This adds support for WebSocket subprotocols to WebSocket DOM objects, with some necessary plumbing to LibWebSocket and its clients. See the associated pull request for how this was tested.
2023-02-01LibWeb+WebContent: Do not reference-count file request objectsTimothy Flynn
There is currently a memory leak with these file request objects due to the callback on_file_request_finish referencing itself in its capture list. This object does not need to be reference counted or allocated on the heap. It is only ever stored in a HashMap until a response is received from the browser, and it is not shared.
2023-01-29AK: Move memory streams from `LibCore`Tim Schumacher
2023-01-29AK: Move `Stream` and `SeekableStream` from `LibCore`Tim Schumacher
`Stream` will be qualified as `AK::Stream` until we remove the `Core::Stream` namespace. `IODevice` now reuses the `SeekMode` that is defined by `SeekableStream`, since defining its own would require us to qualify it with `AK::SeekMode` everywhere.
2023-01-26LibGfx: Remove `try_` prefix from bitmap creation functionsTim Schumacher
Those don't have any non-try counterpart, so we might as well just omit it.
2023-01-18LibGfx+Ladybird+Userland: Don't sniff for TGA images with only raw bytesLiav A
Because TGA images don't have magic bytes as a signature to be detected, instead assume a sequence of ReadonlyBytes is a possible TGA image only if we are given a path so we could check the extension of the file and see if it's a TGA image. When we know the path of the file being loaded, we will try to first check its extension, and only if there's no match to a known decoder, based on simple extension lookup, then we would probe for other formats as usual with the normal sniffing method.
2023-01-12LibCore+Userland: Make Core::Timer::create_single_shot() return ErrorOrSam Atkins
clang-format sure has some interesting opinions about where to put a method call that comes after a lambda. :thonk:
2023-01-05LibWeb+WebContent: Convert BrowsingContext to new pixel unitsSam Atkins
This fixes a few glitches. We no longer give the page double the width it should have, and we mark the correct area of the page as needing repainting.
2022-12-23LibCore: Remove the `force` parameter from File::removeTim Schumacher
About half of the usages were not using `force` anyways, and the other half presumably just got confused about what "force" really means in this context (which is "ignore nonexistent files"). The only 'legitimate' user, which is `rm`, instead now handles this completely internally instead.
2022-12-15headless-browser: Remove option to specify a WebDriver FD-passing socketTimothy Flynn
2022-12-15LibCore: Rename `MemoryStream` to `FixedMemoryStream`Tim Schumacher
This is to differentiate between the upcoming `AllocatingMemoryStream`, which automatically allocates memory as needed instead of operating on a static memory area.
2022-12-14LibGfx+Userland: Make Gfx::SystemTheme propagate errorsCygnix Proto
This patch introduces error propagation to Gfx::SystemTheme to remove instances of release_value_but_fixme_should_propagate_errors(). Userland applications that have been affected by this change have been updated to utilise this propagation and as a result 4 such instances of the aforementioned method have been removed.
2022-12-14LibWeb: Split PaintContext::viewport_rect() into device/css variantsSam Atkins
For now, everyone uses `device_viewport_rect()`, until I convert them.
2022-12-14LibWeb: Make PaintContext aware of CSS and DevicePixelsSam Atkins
Store the ratio between device and CSS pixels on the PaintContext, so that it can convert between the two. Co-authored-by: MacDue <macdue@dueutil.tech>
2022-12-10LibWeb+WebContent+headless-browser: Remove PaintContext::scroll_offset()Sam Atkins
Nobody uses this. They get the scroll_offset from the BlockContainer instead.
2022-12-10LibWeb+WebContent+headless-browser: Use CSSPixels for PageClient eventsSam Atkins
...and also for hit testing, which is involved in most of them. Much of this is temporary conversions and other awkwardness, which should resolve itself as the rest of LibWeb is converted to these new types. Hopefully. :thousandyakstare:
2022-12-10LibWeb+WebContent+headless-browser: Make Page aware of the display scaleSam Atkins
For now, we just report it as "1" everywhere. Replaced `screen_rect()` with `web_exposed_screen_area()` from the spec.
2022-12-08LibGfx+Userland: Make PNGWriter::encode() return ErrorOr<ByteBuffer>Andreas Kling
This is a first step towards handling PNG encoding failures instead of just falling over and crashing the program. This initial step will cause encode() to return an error if the final ByteBuffer copy fails to allocate. There are more potential failures that will be surfaced by subsequent commits. Two FIXMEs were killed in the making of this patch. :^)
2022-12-07Meta+Userland: Pass Gfx::IntPoint by valueMacDue
This is just two ints or 8 bytes or the size of the reference on x86_64 or AArch64.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-11-26LibWeb+WebContent: Label redirects with new FrameLoader::Type::RedirectBaitinq
Previously we labeled redirects as normal FrameLoader::Type::Navigation, now we introduce a new FrameLoader::Type::Redirect and label redirects with it. This will allow us to handle redirects in the browser differently (such as for overwritting the latest history entry when a redirect happens) :^)
2022-11-24headless-browser: Add a mode for being controlled by WebDriverTimothy Flynn
This adds command line flags for WebDriver to pass its IPC socket path (if running on Serenity) or its FD passing socket (if running elsewhere) for the headless-browser to connect to.
2022-11-24LibWeb+WebContent: Virtualize PageClient methods needed for all clientsTimothy Flynn
2022-11-24LibWeb+WebContent: Move pending dialog handling from PageHost to PageTimothy Flynn
Currently, all handling of pending dialogs occurs in PageHost. In order to re-use this functionality to run WebDriver in a headless move, move it to Page.
2022-11-19headless-browser: Port screenshot output to Core::StreamSam Atkins
As noted in https://github.com/SerenityOS/serenity/issues/15239 `headless-browser` is currently broken, with or without these changes.
2022-11-19Everywhere: Remove unnecessary mutable attributes from lambdasMacDue
These lambdas were marked mutable as they captured a Ptr wrapper class by value, which then only returned const-qualified references to the value they point from the previous const pointer operators. Nothing is actually mutating in the lambdas state here, and now that the Ptr operators don't add extra const qualifiers these can be removed.
2022-10-15headless-browser: Add ca-certs-path optionsleeight
2022-09-29AK+Everywhere: Replace "protocol" with "scheme" url helpersnetworkException
URL had properly named replacements for protocol(), set_protocol() and create_with_file_protocol() already. This patch removes these function and updates all call sites to use the functions named according to the specification. See https://url.spec.whatwg.org/#concept-url-scheme
2022-09-21headless-browser: Install EventLoop and Font plugins so it doesn't crashSam Atkins
2022-09-16LibWeb+LibWebView+WebContent: Add Web::Platform::ImageCodecPluginAndreas Kling
This replaces the previous Web::ImageDecoding::Decoder interface. While we're doing this, also move the SerenityOS implementation of this interface from LibWebView to WebContent. That means we no longer have to link with LibImageDecoderClient in applications that use a web view.
2022-08-05LibWeb: Remove page_did_set_document_in_top_level_browsing_context()Andreas Kling
This PageClient callback was never used for anything.
2022-08-01Userland+Base: Make the window titlebar font configurable separatelyAndreas Kling
Instead of defaulting to "bold variant of the system default font", let's allow the user to set any font they want as the titlebar font.
2022-07-19headless-browser: Simplify the arguments used to select resourcesDexesTTP
We can just infer the favicon, fonts and palette from the location of the /res folder, no need to ask each of the resources one by one.
2022-07-19headless-browser: Split the setters for the screen and the viewport rectDexesTTP
These two represent different things, and should be handled by different methods.
2022-07-19headless-browser: Use port 443 as default for HTTPS requestsDexesTTP
2022-06-27Browser+LibWeb+WebContent: Allow Browser to load local filesLucas CHOLLET
To achieve this goal: - The Browser unveils "/tmp/portal/filesystemaccess" - Pass the page through LoadRequest => ResourceLoader - ResourceLoader requests a file to the FileSystemAccessServer via IPC - OutOfProcessWebView handles it and sends a file descriptor back to the Page.
2022-05-29Utilities: Add networking to headless-browserDexesTTP
With this, the headless browser can now connect to the web. Thanks a lot to Ali and Sin-ack for their help with this! Co-authored-by: Ali Mohammad Pur <mpfard@serenityos.org> Co-authored-by: sin-ack <sin-ack@users.noreply.github.com>
2022-05-29Utilities: Add image decoding to headless-browserDexesTTP
With this, the headless browser can now decode images on its own!
2022-05-29Utilities: Add a simple headless-browserDexesTTP
This utility creates a 'screenshot' of the given page after a few seconds of loading.