mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +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:
parent
b3d87f8e37
commit
1f820f8840
Notes:
sideshowbarker
2024-07-17 10:04:37 +09:00
Author: https://github.com/Lubrsi
Commit: 1f820f8840
Pull-request: https://github.com/SerenityOS/serenity/pull/14333
Reviewed-by: https://github.com/linusg
7 changed files with 111 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue