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 plugin constant app.appId #9538

Closed
frostime opened this issue Oct 28, 2023 · 2 comments
Closed

Add plugin constant app.appId #9538

frostime opened this issue Oct 28, 2023 · 2 comments
Assignees
Milestone

Comments

@frostime
Copy link
Contributor

frostime commented Oct 28, 2023

In what scenarios do you need this feature?

一些 API 会在结束的时候调用 PushEvent 方法,这个方法用到了 appId 这个参数用于定位广播的对象。

appId 来源于 Constants.SIYUAN_APPID,它无法直接被开发者访问到。

我现在的办法是,访问 websocket 的 url window.siyuan.ws.ws.url 然后获取到对应的 appId。可否能直接一点,把这个作为一个字段挂载在 window 对象下?

Describe the optimal solution

Constants.SIYUAN_APPID 挂载到 window 下。

Describe the candidate solution

No response

Other information

No response

Vanessa219 added a commit that referenced this issue Oct 28, 2023
@Vanessa219 Vanessa219 changed the title 为开发者提供 appId Add plugin appId Oct 28, 2023
@Vanessa219 Vanessa219 self-assigned this Oct 28, 2023
@Vanessa219 Vanessa219 added this to the 2.10.13 milestone Oct 28, 2023
@Vanessa219
Copy link
Member

this.app.appId

@Vanessa219 Vanessa219 changed the title Add plugin appId Add plugin app.appId Oct 28, 2023
Vanessa219 added a commit to siyuan-note/plugin-sample that referenced this issue Oct 28, 2023
@zxhd863943427
Copy link
Contributor

能否直接挂载Constants到plugin下?

@88250 88250 changed the title Add plugin app.appId Add plugin constant app.appId Oct 30, 2023
appdev pushed a commit to appdev/siyuan-unlock that referenced this issue Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants