微信的这个接口wx.setClipboardData,是指的操作手机的剪贴板吧?

小程序 文章 2021-12-21 17:40 677 0 全屏看文

AI助手支持GPT4.0

微信的这个接口wx.setClipboardData,是指的操作手机的剪贴板吧?This WeChat interface wx.setClipboardData refers to the operation of the clipboard of the mobile phone, right?

微信的这个接口wx.setClipboardData,是指的操作手机的剪贴板吧?
框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug wx.setClipboardData 微信安卓客户端 6.5.3 2.0.0

https://developers.weixin.qq.com/miniprogram/dev/api/device/clipboard/wx.setClipboardData.html

比如我们是用微信小程序做考试的,如果考生切换到手机浏览器搜索了答案,并复制,到了微信小程序进行粘贴,其实一直都是在“系统剪贴板”即手机的内存,也就是这个接口wx.setClipboardData操作的内存部分?

那我定时地调用这个接口wx.setClipboardData会不会覆盖掉考生在微信小程序外部复制的内容?


Framework type problem type API / component name terminal type wechat version basic library version applet bug Wx Setclipboarddata wechat Android client 6.5 3 2.0. 0 https://developers.weixin.qq.com/miniprogram/dev/api/device/clipboard/wx.setClipboardData.html For example, we use wechat applet for the test. If the candidate switches to the mobile browser, searches for the answer, copies it, and pastes it in the wechat applet, it has always been in the "system clipboard", that is, the memory of the mobile phone, that is, this interface Wx Memory part of setclipboarddata operation? Then I call this interface Wx Will setclipboarddata overwrite the content copied by candidates outside the wechat applet?

回答:

拾忆:

如果是为了防止从小程序外复制内容粘贴,可以直接在当前页面非首次onShow的时候覆盖剪切板就行,没必要用定时器。

brave:

输入法有剪切板的功能,我貌似还是可以选择复制的内容的吧

陈绍彬:根据上述描述的场景,那有没有办法阻挡住复制粘贴了?
brave:监听小程序onHide时长吧害
微喵网络:

你的思路很好

陈绍彬:^_^,那就是我的理解是正确的?这个思路可行?
微喵网络:你可以实际试试看,应该是可行的

-EOF-

AI助手支持GPT4.0