From f5b76516002fb0564b205c8835f45195c17416da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Fri, 26 Aug 2022 11:31:28 +0200 Subject: [PATCH] * Add EventSource --- packages/rtl/weborworker.pas | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/rtl/weborworker.pas b/packages/rtl/weborworker.pas index 80876a0..d242fcb 100644 --- a/packages/rtl/weborworker.pas +++ b/packages/rtl/weborworker.pas @@ -1001,6 +1001,24 @@ type property subtle : TJSSubtleCrypto Read Fsubtle; end; + TJSEventSourceOptions = class external name 'Object' (TJSObject) + withCredentials: boolean; + end; + + TJSEventSource = class external name 'EventSource' (TJSEventTarget) + Private + FReadyState : Integer; external name 'readyState'; + fURL : String; external name 'url'; + fwithCredentials : Boolean; external name 'withCredentials'; + Public + constructor new(aURL : String); + constructor new(aURL : String; options: TJSEventSourceOptions); + procedure close; + property readyState : Integer Read FReadyState; + property url : String Read fURL; + property withCredentials: boolean Read FwithCredentials; + end; + { ---------------------------------------------------------------------- Service Worker