gitment icon indicating copy to clipboard operation
gitment copied to clipboard

从微信好友转发访问页面时Gitment无法正常加载评论

Open liangli2718 opened this issue 7 years ago • 4 comments

即便是已经初始化过, Gitment评论框也会显示 "Error: Comments Not Initialized"

原因: 微信转发时会自动在url后添加paramter:

朋友圈 from=groupmessage&isappinstalled=0
好友分享 from=singlemessage&isappinstalled=0

例如 www.example.com/a.html 在微信分享之后会变成www.example.com/a.html?from=singlemessage&isappinstalled=0

由于gitment使用issue里的label作为识别comment的方式,而label就是url,导致同一个页面用普通浏览器和微信内置浏览器访问产生的label不一样。

liangli2718 avatar Dec 05 '17 15:12 liangli2718

解决方案 在construct参数里添加以下两项

link: location.href.split("?")[0].split("#")[0], id: location.href.split("?")[0].split("#")[0]

@Bakumon 感谢修改

liangli2718 avatar Dec 05 '17 16:12 liangli2718

id: location.href.split("?")[0].split("#")[0] 锚点也会有这个问题

Bakumon avatar Dec 08 '17 01:12 Bakumon

Duplicate of #46 #55 #62 #83

liangli2718 avatar Dec 08 '17 10:12 liangli2718

https://advance-esthetic.us/rf-facial-machines

sariabiha avatar Feb 11 '22 11:02 sariabiha