Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add webxdc selfAddr/notify/href/ratelimit APIs (M2/M3) #4366

Open
6 tasks
r10s opened this issue Nov 27, 2024 · 3 comments
Open
6 tasks

add webxdc selfAddr/notify/href/ratelimit APIs (M2/M3) #4366

r10s opened this issue Nov 27, 2024 · 3 comments
Assignees
Labels
blocker This issue is blocking a new release webxdc

Comments

@r10s
Copy link
Member

r10s commented Nov 27, 2024

the following task are open to complete M2/M3 proposal desktop-sided:

  • change window.webxdc.selfAddr to "self_addr" property returned by dc_msg_get_webxdc_info()

  • add and set window.webxdc.sendUpdateInterval to "send_update_interval" property returned by dc_msg_get_webxdc_info()

  • add and set window.webxdc.sendUpdateMaxSize to "send_update_max_size" property returned by dc_msg_get_webxdc_info()

  • when tapping an webxdc-info-message (dc_msg_get_info_type() returns DC_INFO_WEBXDC_INFO_MESSAGE), open the webxdc-app directly, do not move up (instead, the app menu should provide "Show in Chat, cmp add "show in chat" to webxdc menu deltachat-android#3447, but that can also be done later)

  • when opening the webxdc-app from a webxdc-info-message, check dc_msg_get_webxdc_href(). if set, open the app with sth://base/HREF instead of sth://base/index.html
    if the app is already open, make sure, the location is changed (probably the same way), in any case, JavaScript's location properties should be set appropriate and hashchange should be fired as needed

  • listen to event DC_EVENT_INCOMING_WEBXDC_NOTIFY. on receiving, add a notification with text set to "APPNAME: TEXT"; TEXT comes from the event. note, that the msg_id from the event may refer to a webxdc-instance or a webxdc-info-message (in the latter case, use get_parent() to get the instance)

jsonrpc types should be similar; if sth. is missing there, this is another task.

for reference, new spec is available already at https://github.com/webxdc/website/tree/next-main/src-docs/spec (

finally, make sure, the webxdc app does not exit when descr is left out, see #4359

corresponding Android / iOS PR: deltachat/deltachat-android#3438 , deltachat/deltachat-android#3449, deltachat/deltachat-ios#2412

@r10s r10s converted this from a draft issue Nov 27, 2024
@r10s r10s changed the title add webxdc selfAddr/notify/href/ratelimit APIs on Desktop (M2/M3) add webxdc selfAddr/notify/href/ratelimit APIs (M2/M3) Nov 27, 2024
@r10s r10s added webxdc blocker This issue is blocking a new release labels Nov 27, 2024
@Simon-Laux
Copy link
Member

note for person implementing this: for updating/changing webxdc href/url the location change needs to be done in the iframe.

@WofWca
Copy link
Collaborator

WofWca commented Nov 28, 2024

when tapping an webxdc-info-message, open the webxdc-app directly

IDK about the security of this. Do we want to open apps without the user expecting it?

@r10s
Copy link
Member Author

r10s commented Nov 28, 2024

thanks for the thought!

however, it has an app icon etc, no network etc. it is fine to start directly. if that is unexpected for existing users, ppl will learn it. also, the old indirection has barely prevented ppl from opening the app, when they already tapped curiously the info-message :)

@nicodh nicodh self-assigned this Nov 28, 2024
@link2xt link2xt pinned this issue Nov 29, 2024
This was referenced Nov 30, 2024
@r10s r10s moved this from Todo to In Progress in Webxdc PUSH M2/M3 Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker This issue is blocking a new release webxdc
Projects
Status: In Progress
Development

No branches or pull requests

4 participants