mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
LibWeb: Add support for the <base> element changing the base URL
Used by Google seemingly almost all around account sign in and management. The modern sign in page has this near the beginning: ```html <base href="https://accounts.google.com"> ``` All of the XHRs performed by sign in are relative URLs to this base URL. Previously we ignored this and did it relative to the current URL, causing the XHRs to 404 and sign in to fall apart. I presume they do this because you can access the sign in page from multiple endpoints, such as `/ServiceLogin` and `/o/oauth2/auth/identifier`
This commit is contained in:
@@ -62,9 +62,8 @@ String WindowEnvironmentSettingsObject::api_url_character_encoding()
|
||||
// https://html.spec.whatwg.org/multipage/window-object.html#script-settings-for-window-objects:api-base-url
|
||||
AK::URL WindowEnvironmentSettingsObject::api_base_url()
|
||||
{
|
||||
// FIXME: Return the current base URL of window's associated Document.
|
||||
// (This currently just returns the current document URL, not accounting for <base> elements and such)
|
||||
return m_window->associated_document().url();
|
||||
// Return the current base URL of window's associated Document.
|
||||
return m_window->associated_document().base_url();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/window-object.html#script-settings-for-window-objects:concept-settings-object-origin
|
||||
|
||||
Reference in New Issue
Block a user