Age | Commit message (Collapse) | Author |
|
This now defaults to serializing the path with percent decoded segments
(which is what all callers expect), but has an option not to. This fixes
`file://` URLs with spaces in their paths.
The name has been changed to serialize_path() path to make it more clear
that this method will generate a new string each call (except for the
cannot_be_a_base_url() case). A few callers have then been updated to
avoid repeatedly calling this function.
|
|
The error code passed here is expected to be an HTTP error code. Passing
errno codes does not make sense in that context.
|
|
We make a guess using the MIME type guessing API in LibCore. This frees
clients of this code from having to do the guessing.
|
|
If a subresource fails to load, we don't care that we got some custom
404 page. The subresource should still be considered failed.
This is an ad-hoc solution that unbreaks Acid2. This code will
eventually be replaced by fetch mechanisms.
|
|
If an HTTP response fails with an error code (e.g 403) but still has
body content, we now render the content.
We only fall back to our own built-in error page if there's no body.
|
|
|
|
As usual, this removes many unused includes and moves used includes
further down the chain.
|
|
Either take the underlying objects with release_* methods or move() the
instances around.
|
|
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.
|
|
As per Fetch, we are supposed to store cookies from Set-Cookie as soon
as we receive response headers for any HTTP response, even in error
cases.
Required by Twitter to login, as it sets cookies via XHR.
|
|
This generally seems like a better name, especially if we somehow also
need a better name for "read the entire buffer, but not the entire file"
somewhere down the line.
|
|
This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.
One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
|
|
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 :^)
|
|
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.
|
|
Now that we have OS macros for essentially every supported OS, let's try
to use them everywhere.
|
|
|
|
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
|
|
Instead of using Core::EventLoop and Core::Timer directly, LibWeb now
goes through a Web::Platform abstraction layer instead.
This will allow us to plug in Qt's event loop (and QTimer) over in
Ladybird, to avoid having to deal with multiple event loops.
|
|
|
|
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).
No functional changes.
|
|
|
|
|
|
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.
|
|
We were capturing a reference to a stack local and then persisting the
closure, causing it to dereference a long-gone object when invoked.
|
|
Add timeout functionality to ResourceLoader and use it from
XMLHttpRequest.
|
|
Performing DNS prefetch or pre-connect on filtered URLs is wasteful,
as we would block any actual use further down the line.
A bunch of websites perform DNS prefetch and/or pre-connect to trackers
as well, for example:
```
prefetch DNS for 'https://adserver-us.adtech.advertising.com/'
prefetch DNS for 'https://secure.adnxs.com/'
prefetch DNS for 'https://bidder.criteo.com/'
prefetch DNS for 'https://static.criteo.net/'
prefetch DNS for 'https://cdn.krxd.net/'
prefetch DNS for 'https://widgets.outbrain.com/'
prefetch DNS for 'https://images.outbrain.com/'
prefetch DNS for 'https://log.outbrain.com/
prefetch DNS for 'https://amplifypixel.outbrain.com/'
prefetch DNS for 'https://odb.outbrain.com/'
prefetch DNS for 'https://js-sec.indexww.com/'
prefetch DNS for 'https://as-sec.casalemedia.com/'
prefetch DNS for 'https://as.casalemedia.com/'
prefetch DNS for 'https://sofia.trustx.org/'
prefetch DNS for 'https://c.amazon-adsystem.com/'
prefetch DNS for 'https://s.amazon-adsystem.com/'
prefetch DNS for 'https://aax.amazon-adsystem.com/'
prefetch DNS for 'https://t.teads.tv/'
prefetch DNS for 'https://beacon.krxd.net/'
pre-connect to 'https://www.google-analytics.com/'
pre-connect to 'https://www.googletagmanager.com/'
```
|
|
|
|
This is the final component that required LibProtocol as a dependency
of LibWeb. With this, we can now remove the dependency, and LibWeb no
longer requires IPC to work :^)
|
|
- Don't treat an empty `about:blank` resource as an error.
- Give `about:` urls a content-type so `FrameLoader::parse_document()`
won't reject them.
|
|
|
|
There are no remaining users of this API, everyone has been migrated
to asynchronous resource loading.
|
|
|
|
...at least for SOCKS5.
|
|
|
|
|
|
When a Resource is converted to an ImageResource, evict the original
resource from cache. The original resource's data has been moved, so on
a warm reload of a page, when that resource is loaded from cache, it
would not have any data to actually show.
|
|
This fixes an issue on ACID3 where failing image loads with body content
would still get displayed.
|
|
Red is a bit more suspicious than green, after all. :^)
|
|
|
|
This change unfortunately cannot be atomically made without a single
commit changing everything.
Most of the important changes are in LibIPC/Connection.cpp,
LibIPC/ServerConnection.cpp and LibCore/LocalServer.cpp.
The notable changes are:
- IPCCompiler now generates the decode and decode_message functions such
that they take a Core::Stream::LocalSocket instead of the socket fd.
- IPC::Decoder now uses the receive_fd method of LocalSocket instead of
doing system calls directly on the fd.
- IPC::ConnectionBase and related classes now use the Stream API
functions.
- IPC::ServerConnection no longer constructs the socket itself; instead,
a convenience macro, IPC_CLIENT_CONNECTION, is used in place of
C_OBJECT and will generate a static try_create factory function for
the ServerConnection subclass. The subclass is now responsible for
passing the socket constructed in this function to its
ServerConnection base; the socket is passed as the first argument to
the constructor (as a NonnullOwnPtr<Core::Stream::LocalServer>) before
any other arguments.
- The functionality regarding taking over sockets from SystemServer has
been moved to LibIPC/SystemServerTakeover.cpp. The Core::LocalSocket
implementation of this functionality hasn't been deleted due to my
intention of removing this class in the near future and to reduce
noise on this (already quite noisy) PR.
|
|
|
|
|
|
|
|
The success callback may trigger JavaScript execution, causing resource
load times to appear much longer than they actually are. :^)
|
|
Previously we were kinda sorta resolving the reference cycle, but let's
just keep the requests in a hashtable instead of relying on hard to
track refcount tricks.
Fixes #7314.
|
|
Some pages use *really* large data URLs. :^)
|
|
Our current way of signalling a missing port with m_port == 0 was
lacking, as 0 is a valid port number in URLs.
|
|
This namespace will be used for all interfaces defined in the URL
specification, like URL and URLSearchParams.
This has the unfortunate side-effect of requiring us to use the fully
qualified AK::URL name whenever we want to refer to the AK class, so
this commit also fixes all such references.
|
|
When debugging why your website isn't loading in LibWeb the
resource loader is a blind spot as we don't have much logging
except on certain error paths. This can lead to confusing situations
where the browser just appears to hang.
This changes attempts to fix that by adding common success and
failure logging handlers so all resource loading outcomes can
are logged.
|
|
|