mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:57:35 +00:00
LibWeb: Add basic Navigator send beacon support
This commit is contained in:
parent
d262670729
commit
9939b028c6
9 changed files with 156 additions and 0 deletions
25
Userland/Libraries/LibWeb/HTML/NavigatorBeacon.h
Normal file
25
Userland/Libraries/LibWeb/HTML/NavigatorBeacon.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Bastiaan van der Plaat <bastiaan.v.d.plaat@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/Fetch/BodyInit.h>
|
||||
#include <LibWeb/HTML/Navigator.h>
|
||||
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
class NavigatorBeaconMixin {
|
||||
public:
|
||||
WebIDL::ExceptionOr<bool> send_beacon(String const& url, Optional<Fetch::BodyInit> const& data = {});
|
||||
|
||||
private:
|
||||
virtual ~NavigatorBeaconMixin() = default;
|
||||
|
||||
friend class Navigator;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue