Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src-docs/spec/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [1.4] - 2026-04-16

### New APIs

- add `webxdc.isAppSender` and `webxdc.isBroadcast` to allow apps to determine
their role and if they are in a broadcast chat

## [1.3] - 2026-02-11

### Other changes
Expand Down
3 changes: 3 additions & 0 deletions src-docs/spec/messenger.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ When starting a web view for a webxdc app to run, messenger implementors

- MUST support `<meta name="viewport" ...>` is useful especially as webviews from different platforms have different defaults

- MUST support `window.webxdc.isAppSender` and `window.webxdc.isBroadcast`
Comment thread
hpk42 marked this conversation as resolved.
Outdated
to allow apps to determine their role and if they are in a broadcast chat.
Comment thread
hpk42 marked this conversation as resolved.
Outdated

- MUST support `<input type="file">` to allow importing of files;
see [`sendToChat()`](../spec/sendToChat.md) for a way to export files.

Expand Down
18 changes: 18 additions & 0 deletions src-docs/spec/selfAddr_and_selfName.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@ Note that `selfAddr`
- should not be shown in the user interface of the webxdc application
(use `selfName` instead).

## isAppSender

```js
window.webxdc.isAppSender
Comment thread
hpk42 marked this conversation as resolved.
Outdated
```

`isAppSender` is a boolean value that is `true` if the local user is the one
who initially shared the webxdc application in the chat.
If it is `false`, the user is a receiver.

## isBroadcast

```js
window.webxdc.isBroadcast
```

`isBroadcast` is a boolean value that is `true` if the webxdc
application is shared in a broadcast chat context.


## Example using selfAddr and selfName
Expand Down
4 changes: 4 additions & 0 deletions src-docs/webxdc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ interface Webxdc<T> {
selfAddr: string;
/** Returns the peer's own name. This is name chosen by the user in their settings, if there is nothing set, that defaults to the peer's address. */
selfName: string;
/** True if the current user is the sender of this webxdc app. */
isAppSender: boolean;
/** True if the current user is in a broadcast chat. */
isBroadcast: boolean;
/**
* set a listener for new status updates.
* The "serial" specifies the last serial that you know about (defaults to 0).
Expand Down
Loading