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

fix: 微信 Android 内置浏览器兼容性 #322

Merged
merged 3 commits into from
Apr 2, 2023

Conversation

quark-zju
Copy link
Contributor

@quark-zju quark-zju commented Apr 1, 2023

微信 Android 版本 8.0.30

主要有两个问题:

  • 前端 Array.at 不存在
  • 后端 Content-Type 未设,有可能导致 openai api 返回中文时解析为乱码

这些问题主要影响话题总结功能,具体表现为 AI 回复后标题仍为默认标题。

This avoids issues in browsers like WeChat where the encoding is
incorrect and the summary feature does not work if it contains
zh-CN characters.
Also avoid using Array.prototype.at, which does not seem to exist
in the Wexin builtin webview (Android Wexin 8.0.30).
@vercel
Copy link

vercel bot commented Apr 1, 2023

Someone is attempting to deploy a commit to a Personal Account owned by @Yidadaa on Vercel.

@Yidadaa first needs to authorize it.

@quark-zju quark-zju changed the title 微信 Android 内置浏览器兼容性 fix: 微信 Android 内置浏览器兼容性 Apr 1, 2023
@Yidadaa
Copy link
Collaborator

Yidadaa commented Apr 1, 2023

请尝试增加一个 Array.at 的 polyfill 来解决 .at 的兼容性问题,因为 js 中直接取数组下标的方式是类型不安全的。

This fixes compatibility issue with older browsers like WeChat webview.
The summary feature now works as expected.
@AprilNEA
Copy link
Contributor

AprilNEA commented Apr 2, 2023

Array.at 问题在微信浏览器外也会出现

@vercel
Copy link

vercel bot commented Apr 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
chat-gpt-next-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 2, 2023 5:08am

@Yidadaa Yidadaa merged commit a64c438 into ChatGPTNextWeb:main Apr 2, 2023
@Yidadaa
Copy link
Collaborator

Yidadaa commented Apr 2, 2023

@Yidadaa

这个 pr 让产物的大小从 100kb 上升到了 111kb,需要删掉引入的三方库,手动实现 polyfill

yxl pushed a commit to yxl/ChatGPT-Next-Web that referenced this pull request May 4, 2023
fix: 微信 Android 内置浏览器兼容性
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants