This commit is contained in:
Dave Conway-Jones 2023-07-31 09:34:58 +01:00
commit 8e075d891a
No known key found for this signature in database
GPG Key ID: 1DDB0E91A28C2643
2 changed files with 5 additions and 2 deletions

View File

@ -363,7 +363,10 @@ All actions also include a:
`msg._sessionid` property that indicates which client session they came from. Any msg sent out that includes this property will ONLY be sent to that session - so you can target map updates to specific sessions if required. `msg._sessionid` property that indicates which client session they came from. Any msg sent out that includes this property will ONLY be sent to that session - so you can target map updates to specific sessions if required.
`msg._sessionip` property that shows the ip of the client that is connected to the session. `msg._sessionip` property that shows the ip of the client that is connected to the session.
The "connected" action also include a `msg._clientheaders` property that shows the headers sent by the client to make a connection to the session. The "connected" action additionally includes a:
`msg.payload.parameters` property object that lists the parameters sent in the url.
`msg.payload.clientTimezone` property string showing the clients local Timezone. Returns bool of `false` if unable to retrive clients local Timezone.
`msg._clientheaders` property that shows the headers sent by the client to make a connection to the session.
### Utility functions ### Utility functions

View File

@ -63,7 +63,7 @@ var connect = function() {
if (!inIframe) { if (!inIframe) {
document.getElementById("footer").innerHTML = "<font color='#494'>"+pagefoot+"</font>"; document.getElementById("footer").innerHTML = "<font color='#494'>"+pagefoot+"</font>";
} }
ws.send(JSON.stringify({action:"connected",parameters:Object.fromEntries((new URL(location)).searchParams)})); ws.send(JSON.stringify({action:"connected",parameters:Object.fromEntries((new URL(location)).searchParams),clientTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone || false}));
onoffline(); onoffline();
}; };
ws.onclose = function() { ws.onclose = function() {