summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/XHR
AgeCommit message (Collapse)Author
2022-02-12LibWeb: Decode XHR text with the specified charset in the MIME typeLuke Wilde
The MIME type can come from either the Content-Type header in the response header list, or the overridden MIME type passed into overrideMimeType() This is required by Google Maps, which downloads blobs encoded in x-user-defined format.
2022-02-12LibWeb: Implement XMLHttpRequest.overrideMimeTypeLuke Wilde
This allows you to ignore the Content-Type returned by the server and always parse the content as if it's the given MIME type. This will currently be used for allowing you to override the charset of text responses.
2022-02-08LibWeb: Rewrite EventTarget to more closely match the specLuke Wilde
This isn't perfect (especially the global object situation in activate_event_handler), but I believe it's in a much more complete state now :^) This fixes the issue of crashing in prepare_for_ordinary_call with the `i < m_size` crash, as it now uses the IDL callback functions which requires the Environment Settings Object. The environment settings object for the callback is fetched at the time the callback is created, for example, WrapperGenerator gets the incumbent settings object for the callback at the time of wrapping. This allows us to remove passing in ScriptExecutionContext into EventTarget's constructor. With this, we can now drop ScriptExecutionContext.
2022-01-24Everywhere: Convert ByteBuffer factory methods from Optional -> ErrorOrSam Atkins
Apologies for the enormous commit, but I don't see a way to split this up nicely. In the vast majority of cases it's a simple change. A few extra places can use TRY instead of manual error checking though. :^)
2021-10-04LibWeb: Don't send a request body in XMLHttpRequest GET or HEADAndreas Kling
2021-10-01LibWeb: Add the missing ProgressEvent IDL constructorIdan Horowitz
2021-09-27LibWeb: Allow passing a (String) body to XMLHttpRequest.send()Andreas Kling
This patch implements the simplest form of send(body): strings.
2021-09-25LibWeb: Provide a default DOM::EventTarget::dispatch_event()Andreas Kling
All EventTarget subclasses except Window do the same exact thing in their overrides, so let's just share an implementation in the base.
2021-09-19LibWeb: Implement XMLHttpRequest.getAllResponseHeaders()Andreas Kling
2021-09-19LibWeb: Use an enumerator macro for XMLHttpRequestEventTarget accessorsAndreas Kling
2021-09-19LibWeb: Keep XMLHttpRequest alive while handling load/error eventsAndreas Kling
A weakly held XHR object is not guaranteed to remain alive after running arbitrary JavaScript, so let's make sure we take a strong reference in the ResourceLoader callbacks here.
2021-09-19LibWeb: Remove unnecessary WeakPtr creation in XMLHttpRequest::send()Andreas Kling
2021-09-19LibWeb: Add event handler attributes to XMLHttpRequestEventTargetAndreas Kling
This patch adds the following event handler attributes to XHR's EventTarget base class: - onloadstart - onprogress - onabort - onerror - onload - ontimeout - onloadend
2021-09-19LibWeb: Implement XMLHttpRequest.onreadystatechangeAndreas Kling
2021-09-14AK: Make URL::m_port an Optional<u16>, Expose raw port getterIdan Horowitz
Our current way of signalling a missing port with m_port == 0 was lacking, as 0 is a valid port number in URLs.
2021-09-13LibWeb: Add the Web::URL namespace and move URLEncoder to itIdan Horowitz
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.
2021-09-12LibWeb+Browser: Add Debug menu action for toggling Same-Origin PolicyAndreas Kling
Sometimes it's useful to turn off the SOP for testing purposes. Let's make that easy by having a Debug menu item for it. :^)
2021-09-09LibWeb: Rename Document::complete_url() => parse_url()Andreas Kling
This better matches the spec nomenclature.
2021-09-09LibWeb: Rename DOM::Window::document() => associated_document()Andreas Kling
Match the spec nomenclature.
2021-09-09LibWeb: Add DOM::Window::page()Andreas Kling
This helps us to get from a Window to the containing Page, without clients having to go through Document.
2021-09-06Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safeAli Mohammad Pur
2021-06-27LibJS: Rename Function => FunctionObjectAndreas Kling
2021-05-16AK+Userland: Remove nullability feature for the ByteBuffer typeGunnar Beutner
Nobody seems to use this particular feature, in fact there were some bugs which were uncovered by removing operator bool.
2021-04-23AK: Rename adopt() to adopt_ref()Andreas Kling
This makes it more symmetrical with adopt_own() (which is used to create a NonnullOwnPtr from the result of a naked new.)
2021-04-22Everywhere: Use linusg@serenityos.org for my copyright headersLinus Groh
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-15LibWeb: Set Cookie header on remaining resource requestsTimothy Flynn
2021-04-03LibWeb: Implement XMLHttpRequest.getResponseHeader()Linus Groh
This lets jQuery's AJAX functionality progress further :^)
2021-04-03LibWeb: Implement XMLHttpRequest.statusLinus Groh
This lets jQuery's AJAX functionality progress further :^)
2021-04-03LibWeb: Make XMLHttpRequest.open() work with relative URLsLinus Groh
2021-04-03LibWeb: Pass optional status code to ResourceLoader callbacksLinus Groh
This is needed for XMLHttpRequest, and will certainly be useful for other things, too.
2021-02-20LibWeb: Use DOMException in XMLHttpRequest::send()Linus Groh
2021-02-20LibWeb: Use DOMException in XMLHttpRequest::open()Linus Groh
2021-02-20LibWeb: Use DOMException in XMLHttpRequest::set_request_header()Linus Groh
2021-02-17LibWeb: Add constructor to XMLHttpRequest IDL interfaceLinus Groh
2021-02-10LibWeb: Remove a whole bunch of unnecessary #includesAndreas Kling
2021-01-23LibWeb: Add XHREventTarget and have XHR inherit from itLuke
2021-01-23LibWeb: Flesh out existing XHR methods a bit moreLuke
This makes open, send and setRequestHeader a bit more spec compliant and adds a bunch of FIXMEs for unimplemented parts.
2021-01-23LibWeb: Generate JS bindings for XMLHttpRequest from IDL :^)Andreas Kling
Remove the hand-written XHR bindings in favor of generated ones.
2021-01-23LibWeb: Move XMLHttpRequest to separate XHR directoryAndreas Kling
In keeping with the one-directory-per-web-spec layout, let's move XHR into its own clubhouse.