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

[Feat]: 建议框架提供一个界面修改监听器,以免每个插件自行实现 #92

Open
4 tasks done
xh321 opened this issue Aug 8, 2023 · 2 comments
Open
4 tasks done
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@xh321
Copy link
Collaborator

xh321 commented Aug 8, 2023

请确保您已阅读以上注意事项,并勾选下方的确认框。

  • 我确定这是一个从未被提出和实现过的功能。
  • 我已经在 Issue Tracker 以及 Pull Request 中找过我要提出的功能,没有找到相同功能的ISSUE和PR。
  • 我已知晓并同意,此处仅用于建议新功能。若这个 Issue 是关于其他非主题的问题,则我的 Issue 可能会被无条件自动关闭或/并锁定。
  • 我已知晓并同意,如果我不按照模板提供的指示进行填写,则我的 Issue 可能会被无条件删除。

需要添加的功能内容

建议在框架层对聊天界面等常用区域的界面变动进行监听(利用MutationObserver),监听到界面变动事件可以对插件进行回调(例如onChatViewChanged等)以免每个插件自行实现,麻烦且不说,插件多了也可能影响性能。

@xh321 xh321 added the enhancement New feature or request label Aug 8, 2023
@mo-jinran mo-jinran added the good first issue Good for newcomers label Aug 13, 2023
@TalexDreamSoul
Copy link

修改指什么意思,没太能理解

指插件修改还是什么?

@xh321
Copy link
Collaborator Author

xh321 commented Aug 29, 2023

修改指什么意思,没太能理解

指插件修改还是什么?

确切来说是界面变动。现有插件很多都会通过监听界面变动来进行插入自己的元素。例如,如果你想在聊天界面每条消息后面插入一个时间,你就需要监听聊天界面变动,因为聊天界面滚动会导致元素创建与销毁,不监听的话,滚动一下你插入的时间就被“还原”了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants