mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:37:46 +00:00
LibWeb: Implement document.domain getter
The document.domain setter is currently stubbed as that is a doozy to implement, given how much restrictions there are in place to try and prevent use of it and potential multi-process implications. This was the only thing preventing us from being able to start displaying ads delivered via Google Syndication.
This commit is contained in:
parent
6290a25224
commit
6a4934a030
4 changed files with 37 additions and 0 deletions
|
@ -92,6 +92,19 @@ public:
|
|||
return result.to_string();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/origin.html#concept-origin-effective-domain
|
||||
Optional<String> effective_domain() const
|
||||
{
|
||||
// 1. If origin is an opaque origin, then return null.
|
||||
if (is_opaque())
|
||||
return Optional<String> {};
|
||||
|
||||
// FIXME: 2. If origin's domain is non-null, then return origin's domain.
|
||||
|
||||
// 3. Return origin's host.
|
||||
return m_host;
|
||||
}
|
||||
|
||||
bool operator==(Origin const& other) const { return is_same_origin(other); }
|
||||
bool operator!=(Origin const& other) const { return !is_same_origin(other); }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue