From 2414d740026ea72686223d83ee98704accda5e07 Mon Sep 17 00:00:00 2001 From: Ivan Hetman Date: Thu, 3 Oct 2024 20:36:15 +0300 Subject: [PATCH] JSO: add API to send beacon (#956) --- jso/apis/src/main/java/org/teavm/jso/browser/Navigator.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jso/apis/src/main/java/org/teavm/jso/browser/Navigator.java b/jso/apis/src/main/java/org/teavm/jso/browser/Navigator.java index af955cb8d..eb8c56644 100644 --- a/jso/apis/src/main/java/org/teavm/jso/browser/Navigator.java +++ b/jso/apis/src/main/java/org/teavm/jso/browser/Navigator.java @@ -47,4 +47,10 @@ public final class Navigator implements JSObject { @JSBody(script = "return navigator.hardwareConcurrency") public static native int hardwareConcurrency(); + + public static native boolean sendBeacon(String url); + + public static native boolean sendBeacon(String url, String data); + + public static native boolean sendBeacon(String url, JSObject data); }