首页 新闻 会员 周边

websocket在谷歌浏览器上自动断开

0
[待解决问题]

websocket实现一个后台数据更新, 自动刷新页面的功能,在本地测试过都没有问题,部署以后在火狐上可以,所有谷歌内核的浏览器都会自动断开,没有任何报错,有个提示不知道是不是有关系,有大佬知道怎么解决吗

Audit usage of navigator.userAgent, navigator.appVersion, and navigator.platform

A page or script is accessing at least one of navigator.userAgent, navigator.appVersion, and navigator.platform. Starting in Chrome 101, the amount of information available in the User Agent string will be reduced.
To fix this issue, replace the usage of navigator.userAgent, navigator.appVersion, and navigator.platform with feature detection, progressive enhancement, or migrate to navigator.userAgentData.
Note that for performance reasons, only the first access to one of the properties is shown.
1 source

问题补充:


在控制台尝试打印了关闭前的信息,错误码报的是1006,原因显示空“”

团子0621的主页 团子0621 | 菜鸟二级 | 园豆:202
提问于:2022-05-10 16:39

贴下服务端socket read代码

luzemin 1年前

@luzemin: 没有报错,也没提示断开,也接收不到消息,在火狐上断开时有输出连接断开

团子0621 1年前
< >
分享
所有回答(1)
0

是不是goole浏览器的设置问题

智客工坊 | 园豆:1855 (小虾三级) | 2022-05-10 18:53

试了下还是不行

支持(0) 反对(0) 团子0621 | 园豆:202 (菜鸟二级) | 2022-05-11 08:08
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册