mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-08 05:27:14 +09:00
LibWeb: Stub CacheStorage interface
With this change we can again open login form https://discord.com/login instead of failing in js because `caches.open()` is not defined.
This commit is contained in:
parent
28bfe701b7
commit
7efdd1c1ec
Notes:
github-actions[bot]
2025-06-05 21:03:31 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 7efdd1c1ec
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5012
10 changed files with 102 additions and 0 deletions
33
Libraries/LibWeb/ServiceWorker/CacheStorage.cpp
Normal file
33
Libraries/LibWeb/ServiceWorker/CacheStorage.cpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Copyright (c) 2025, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Bindings/CacheStoragePrototype.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/ServiceWorker/CacheStorage.h>
|
||||
#include <LibWeb/WebIDL/Promise.h>
|
||||
|
||||
namespace Web::ServiceWorker {
|
||||
|
||||
GC_DEFINE_ALLOCATOR(CacheStorage);
|
||||
|
||||
CacheStorage::CacheStorage(JS::Realm& realm)
|
||||
: Bindings::PlatformObject(realm)
|
||||
{
|
||||
}
|
||||
|
||||
void CacheStorage::initialize(JS::Realm& realm)
|
||||
{
|
||||
Base::initialize(realm);
|
||||
WEB_SET_PROTOTYPE_FOR_INTERFACE(CacheStorage);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/ServiceWorker/#cache-storage-open
|
||||
GC::Ref<WebIDL::Promise> CacheStorage::open(String const&)
|
||||
{
|
||||
return WebIDL::create_rejected_promise(realm(), WebIDL::NotSupportedError::create(realm(), "CacheStorage.open() is not yet implemented"_string));
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue