summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Loader
AgeCommit message (Collapse)Author
2021-01-09LibWeb: Convert a bunch of dbg() to dbgln()Andreas Kling
2021-01-05LibWeb: Add a basic content filter (ad blocking!) :^)Andreas Kling
This patch adds a global (per-process) filter list to LibWeb that is used to filter all outgoing resource load requests. Basically we check the URL against a list of filter patterns and if it's a match for any one of them, we immediately fail the load. The filter list is a simple text file: ~/.config/BrowserContentFilters.txt It's one filter per line and they are simple glob filters for now, with implicit asterisks (*) at the start and end of the line.
2021-01-03LibWeb: Convert a bunch of String::format() => String::formatted()Andreas Kling
2020-12-31LibWeb: Clear circular download reference when download finishedTom
2020-12-31LibWeb: Don't hold on to the Download instance after it's finishedAnotherTest
Fixes* 4668
2020-12-30LibWeb: Re-enable favicons after forgotten if-0AnotherTest
2020-12-30ProtocolServer: Stream the downloaded data if possibleAnotherTest
This patchset makes ProtocolServer stream the downloads to its client (LibProtocol), and as such changes the download API; a possible download lifecycle could be as such: notation = client->server:'>', server->client:'<', pipe activity:'*' ``` > StartDownload(GET, url, headers, {}) < Response(0, fd 8) * {data, 1024b} < HeadersBecameAvailable(0, response_headers, 200) < DownloadProgress(0, 4K, 1024) * {data, 1024b} * {data, 1024b} < DownloadProgress(0, 4K, 2048) * {data, 1024b} < DownloadProgress(0, 4K, 1024) < DownloadFinished(0, true, 4K) ``` Since managing the received file descriptor is a pain, LibProtocol implements `Download::stream_into(OutputStream)`, which can be used to stream the download into any given output stream (be it a file, or memory, or writing stuff with a delay, etc.). Also, as some of the users of this API require all the downloaded data upfront, LibProtocol also implements `set_should_buffer_all_input()`, which causes the download instance to buffer all the data until the download is complete, and to call the `on_buffered_download_finish` hook.
2020-12-19LibWeb: Don't use ByteBuffer::wrap() when loading about: URLsAndreas Kling
Let's just copy an empty string here to make ourselves a ByteBuffer.
2020-12-19LibProtocol: Remove use of ByteBuffer::wrap() in protocol APIAndreas Kling
2020-12-13LibWeb: Set the encoding of HTML documentsAndreas Kling
Now that we attach the document to the frame before parsing, we have to make sure we set the encoding on the document before parsing, or things may not turn out well.
2020-12-13LibWeb: Attach DOM::Document to its frame before parsingAndreas Kling
FrameLoader now begins by constructing a DOM::Document, and then builds a document tree inside it based on the MIME type. For text/html we pass control to the HTMLDocumentParser as before. This gives us access to things like window.alert() during parsing. Fixes #3973.
2020-12-13LibWeb: Make HTMLDocumentParser take an existing documentAndreas Kling
We shouldn't really be creating the document objects inside the parser, since that makes it hard to hook up e.g JavaScript bindings early on.
2020-12-08LibWeb+WebContent: Add on_load_finish hook to web viewsAndreas Kling
This isn't entirely symmetrical with on_load_start as it will also fire on reloads and back/forward navigations. However, it's good enough for some basic use cases, and we can do more sophisticated notifications later on when we need them.
2020-11-14LibWeb: Use standardized encoding names, add encoding attribute to documentLuke
2020-11-13LibWeb: Add contentType attribute to DocumentLuke
2020-11-12LibWeb: Make Frame point weakly to PageAndreas Kling
This patch makes Page weakable and allows page-less frames to exist. Page is single-owner, and Frame is multiple-owner, so it's not sound for Frame to assume its containing Page will stick around for its own entire lifetime. Fixes #3976.
2020-11-11LibWeb: Advertise to servers that we support gzip encodingLuke
We've had gzip support for a while now, but it never really got used because we never advertised it.
2020-11-07LibWeb: Load favicon.ico only for http/https URLsBrendan Coles
2020-10-23LibWeb: Fix Document construction mishap in <template> elementAndreas Kling
Ref-counted objects must not be stack allocated. Make DOM::Document's constructor private to avoid this issue. (I wish we could mark classes as heap-only..)
2020-10-22LibWeb: Add namespace to ElementLuke
2020-10-21LibCore+WebServer+LibWeb: Make MIME type guesser take a StringViewAndreas Kling
This reverts my previous commit in WebServer and fixes the whole issue in a much better way. Instead of having the MIME type guesser take a URL (which we don't actually have in the WebServer at that point), just take a path as a StringView. Also, make use of the case-insensitive StringView::ends_with() :^)
2020-10-08LibWeb: Handle PageClient::page_did_change_title() in Frame::set_document()Linus Groh
2020-10-08LibWeb: Add FrameLoader::load_html()Linus Groh
This moves responsibility for parsing and loading the document from InProcessWebView to FrameLoader, so can be re-used easily.
2020-10-06LibWeb: Fix build after GEMINI_DEBUG oopsieAndreas Kling
2020-10-06LibWeb: Add debug toggle for dumping gemini documentsNico Weber
2020-10-06LibWeb: Fix variable name for gemini documentsNico Weber
2020-09-28LibWeb: LoadRequest::operator==() should compare header valuesAndreas Kling
It was only comparing header names. Thanks to @Sponji for noticing!
2020-09-28ProtocolServer+LibWeb: Support more detailed HTTP requestsAndreas Kling
This patch adds the ability for ProtocolServer clients to specify which HTTP method to use, and also to include an optional HTTP request body.
2020-09-28LibWeb: Expand LoadRequest class to include method, headers and bodyAndreas Kling
This will allow us to create more detailed requests from inside the web engine.
2020-09-22LibWeb: Dispatch DOM "load" event on <iframe> elementsAndreas Kling
2020-09-15LibCore: Make Core::Object properties more dynamicAndreas Kling
Instead of everyone overriding save_to() and set_property() and doing a pretty asymmetric job of implementing the various properties, let's add a bit of structure here. Object properties are now represented by a Core::Property. Properties are registered with a getter and setter (optional) in constructors. I've added some convenience macros for creating and registering properties, but this does still feel a bit bulky. We'll have to iterate on this and see where it goes.
2020-09-12LibWeb: cache in-process decoded images in ImageResourcePeter Nelson
Otherwise cloned Bitmaps returned by the decoder will be prematurely freed
2020-09-08LibWeb: make it possible to directly load .svg filesSimon Danner
Make LibWeb load svg files by guessing the svg mime type from the file extension and parsing it with the HTML parser.
2020-08-12LibWeb: Mark compilation-unit-only functions as staticBen Wiederhake
This enables a nice warning in case a function becomes dead code. Also, in the case of {Event,Node}WrapperFactory.cpp, the corresponding header was forgotten. This would cause an issue later when we enable -Wmissing-declarations. Is my clang-format misconfigured? Why is the diff for NodeWrapperFactory.cpp so large?
2020-08-12LibWeb: Until an image has loaded or failed, don't occupy layout sizeAndreas Kling
This patch makes images have an implicit zero intrinsic size before they have either loaded or failed to load. This is tracked by the ImageLoader object. This fixes a long-standing issue with images occupying empty 150x150 rectangles of space.
2020-08-06Refactor: Expose const_cast by removing ByteBuffer::warp(const void*, size_t)asynts
This function did a const_cast internally which made the call side look "safe". This method is removed completely and call sites are replaced with ByteBuffer::wrap(const_cast<void*>(data), size) which makes the behaviour obvious.
2020-08-02ProtocolServer+LibTLS: Pipe certificate requests from LibTLS to clientsAnotherTest
This makes gemini.circumlunar.space (and some more gemini pages) work again :^)
2020-07-30LibWeb: Complete the redirect URL before loading itAnotherTest
the "Location" header is allowed to be a relative URL (as is the case in our very own WebServer!)
2020-07-28LibWeb: Move the Page/Frame/EventHandler classes into Page/Andreas Kling
2020-07-28LibWeb: Move the HTML parser into HTML/Parser/Andreas Kling
2020-07-28LibWeb: Move HTML classes into the Web::HTML namespaceAndreas Kling
2020-07-27LibCore+LibWeb: Move guess-mimetype-based-on-filename logic to LibCoreAndreas Kling
This could be useful in more places.
2020-07-26LibWeb: Move DOM classes into the Web::DOM namespaceAndreas Kling
LibWeb keeps growing and the Web namespace is filling up fast. Let's put DOM stuff into Web::DOM, just like we already started doing with SVG stuff in Web::SVG.
2020-07-26LibWeb: Move HTML object model stuff into LibWeb/HTML/Andreas Kling
Take a hint from SVG and more all the HTML classes into HTML instead of mixing them with the DOM classes.
2020-07-08LibWeb: Add type for FrameLoader::loadKevin Meyer
This should enable to destinguish between IFrame, Reload and Navigation motivated loads in order to call the appropriate hooks. This change is motivated as loading the IFrame test page causes the IFrame url to be added to the history and shows up as the current browser location bar.
2020-06-27LibWeb: Add "image/x‑portable‑graymap" mime type for pgm file extensionHüseyin ASLITÜRK
2020-06-26LibWeb+Browser: Remove old HTML parser :^)Andreas Kling
The new parser is now used everywhere and it's working pretty well!
2020-06-26LibWeb: Tolerate quoted HTTP Content-Type encodingsAndreas Kling
2020-06-26LibWeb: Let's not pass "%u" to String() and expect something to happenAndreas Kling
2020-06-25LibWeb: Treat all HTTP 4xx codes as errorsAndreas Kling