vditor
vditor copied to clipboard
document.execCommand('insertHTML', false, succFileText)
编辑模式
wysiwyg所见即所得模式 document.execCommand('insertHTML', false, succFileText)不在被支持, mdn文档中明确提出:https://developer.mozilla.org/zh-CN/docs/web/api/document/execcommand#%E6%B5%8F%E8%A7%88%E5%99%A8%E5%85%BC%E5%AE%B9%E6%80%A7 同时Firefox最新版已经不支持。
描述问题
上传图片插入地址到正文失败:document.execCommand('insertHTML', false, succFileText)
期待的结果
替代品
截屏或录像
Google浏览器偶发性出现该问题:
Firefox最新版完全不支持:

-->
版本信息
- 版本:
- 操作系统:win11 pro
- 浏览器: firefox 102.1版本
其他信息
@Vanessa219 @88250 @gaoyoubo
Chrome 上是什么情况下返回 false?Firefox 我这里没有安装,是上传功能用不了了么?
Chrome 上是什么情况下返回 false?Firefox 我这里没有安装,是上传功能用不了了么? 是Firefox中无法通过document.execCommand('insertHTML', false, succFileText)指令插入
你是在什么时候调用这个方法呢?是不是没有 focus
是的
调用的时候需要 focus 哦,否则任何浏览器都不会成功的。