mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 06:07:34 +00:00
LibWeb/HTML: Implement WorkerGlobalScope::origin()
This commit is contained in:
parent
552895da60
commit
d1a7c39e76
2 changed files with 7 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2022, Andrew Kaster <akaster@serenityos.org>
|
* Copyright (c) 2022, Andrew Kaster <akaster@serenityos.org>
|
||||||
|
* Copyright (c) 2023, Linus Groh <linusg@serenityos.org>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -104,10 +105,12 @@ ENUMERATE_WORKER_GLOBAL_SCOPE_EVENT_HANDLERS(__ENUMERATE)
|
||||||
#undef __ENUMERATE
|
#undef __ENUMERATE
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/webappapis.html#dom-origin
|
// https://html.spec.whatwg.org/multipage/webappapis.html#dom-origin
|
||||||
String WorkerGlobalScope::origin() const
|
WebIDL::ExceptionOr<String> WorkerGlobalScope::origin() const
|
||||||
{
|
{
|
||||||
// FIXME: The origin getter steps are to return this's relevant settings object's origin, serialized.
|
auto& vm = this->vm();
|
||||||
return {};
|
|
||||||
|
// The origin getter steps are to return this's relevant settings object's origin, serialized.
|
||||||
|
return TRY_OR_THROW_OOM(vm, String::from_deprecated_string(relevant_settings_object(this_impl()).origin().serialize()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/webappapis.html#dom-issecurecontext
|
// https://html.spec.whatwg.org/multipage/webappapis.html#dom-issecurecontext
|
||||||
|
|
|
@ -54,7 +54,7 @@ public:
|
||||||
// Following methods are from the WindowOrWorkerGlobalScope mixin
|
// Following methods are from the WindowOrWorkerGlobalScope mixin
|
||||||
// https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope-mixin
|
// https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope-mixin
|
||||||
|
|
||||||
String origin() const;
|
WebIDL::ExceptionOr<String> origin() const;
|
||||||
bool is_secure_context() const;
|
bool is_secure_context() const;
|
||||||
bool cross_origin_isolated() const;
|
bool cross_origin_isolated() const;
|
||||||
WebIDL::ExceptionOr<String> btoa(String const& data) const;
|
WebIDL::ExceptionOr<String> btoa(String const& data) const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue