gpt4 book ai didi

javascript - Microsoft Edge 版本 40/15 剪贴板返回奇怪的字符串 'text/html'

转载 作者:行者123 更新时间:2023-11-28 04:40:11 25 4
gpt4 key购买 nike

我刚刚发现在 Microsoft Edge v40/15 中,当您粘贴 <div contenteditable=true> 中的一些文本时,进入相同的<div>并通过 e.clipboard.getData("text/html") 获取数据,我得到的是一些令人困惑的东西,而不是我粘贴的部分,我得到了一堆类似调试信息的东西,如下图所示(在 <div id="display"> 内),我实际粘贴的只是 <p>paragraph element</p> :

enter image description here

我给它做了一个jsfiddle,你可以试试:https://jsfiddle.net/larryzhao/wfy60y07/ 。将 contenteditable div 中的某些内容粘贴到 Microsoft Edge v40/15 的同一 div 中,该内容将显示在下面的 div 中。

我想知道 Microsoft Edge v40/15 是否公开发布?这是 Microsoft Edge 的错误还是功能?我在网络上找不到它。

最佳答案

在 Edge 40/15 中,微软已将 text/html 部分添加到剪贴板,在以前的版本中(即使是目前公开的版本),它甚至不可用。

您认为是调试信息的部分是微软多年来一直添加到剪贴板的内容(尽管我不知道任何细节)。因此,人们可以非常确定它会一直存在。我想解决这个问题的唯一方法是让您的代码适应它的存在。

Edge 40/15 中的 text/html 内容还存在另一个问题:https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11877517/ .

The word document contains unicode characters that are corrupted when pasting into Edge. The pasted content appears fine in ContentEditable, but the data we receive in JavaScript has been translated into what looks like ASCII.

Looking at the second paragraph in the HTML clipboard contents, we expect (and confirmed in Chrome/Firefox):

śƿęċīǟƪ characters

Instead Edge gives us:

śƿęċīǟƪ characters

关于javascript - Microsoft Edge 版本 40/15 剪贴板返回奇怪的字符串 'text/html',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43853881/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com