mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Implement initial version of navigator.sendBeacon
(#38301)
Gated behind the feature flag `dom_navigator_sendbeacon_enabled` as the `keep-alive` fetch parameter is crucial for real-life use cases such as analytics requests. Part of #4577 Part of #38302 Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
parent
181f97879d
commit
dbb886fad2
22 changed files with 237 additions and 29 deletions
|
@ -23,9 +23,10 @@ use crate::script_runtime::CanGc;
|
|||
// TODO Cross origin resources MUST BE INCLUDED as PerformanceResourceTiming objects
|
||||
// https://w3c.github.io/resource-timing/#sec-cross-origin-resources
|
||||
|
||||
// TODO CSS, Beacon
|
||||
// TODO CSS
|
||||
#[derive(Debug, JSTraceable, MallocSizeOf, PartialEq)]
|
||||
pub(crate) enum InitiatorType {
|
||||
Beacon,
|
||||
LocalName(String),
|
||||
Navigation,
|
||||
XMLHttpRequest,
|
||||
|
@ -191,6 +192,7 @@ impl PerformanceResourceTimingMethods<crate::DomTypeHolder> for PerformanceResou
|
|||
// https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-initiatortype
|
||||
fn InitiatorType(&self) -> DOMString {
|
||||
match self.initiator_type {
|
||||
InitiatorType::Beacon => DOMString::from("beacon"),
|
||||
InitiatorType::LocalName(ref n) => DOMString::from(n.clone()),
|
||||
InitiatorType::Navigation => DOMString::from("navigation"),
|
||||
InitiatorType::XMLHttpRequest => DOMString::from("xmlhttprequest"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue