问题描述:
https://github.com/zenorocha/clipboard.js/wiki/Known-Issues
On IE9-11 there's a prompt that asks if the user wants to allow access to his/her clipboard.
If the user allows, everything will work as expected. But if the user denies access, it will still emit the success event. The root cause of the problem is that document.execCommand returns true even if it does not have permissions.

//original code:
try { e = document.execCommand(this.action) } catch (n) { e = !1 }
//moidfied code:
try { e = window.clipboardData ? window.clipboardData.setData('Text', this.selectedText) : document.execCommand(this.action) } catch (n) { e = !1 }

  

clipboard.js IE下 不允许复制时, 问题修改的更多相关文章

  1. Vue使用Clipboard.JS在h5页面中复制内容

    安装clipboard.js github路径:https://github.com/zenorocha/clipboard.js 安装: npm install clipboard --save 引 ...

  2. Clipboard.js : 移动端浏览器实现网页内容复制

    .bl { padding: 5px 10px; border-left: 3px solid #009a61; background: #f6f6f6; color: #555; font-size ...

  3. 使用clipboard.js实现复制内容至剪贴板

    下载插件 clipboard.js是不依赖flash,实现复制内容至剪贴板的js插件.下载clipboard.js的压缩包,根据需要选择dist目录下的压缩或未压缩版. github地址:https: ...

  4. clipboard.js一个可以在移动端一键复制的插件

    网址:https://clipboardjs.com/ 使用方法: 1.引入js <script src="dist/clipboard.min.js"></sc ...

  5. clipboard.js -- js实现将文本复制到剪贴板的方法

    资源 推荐使用:clipboard.js 官方教程地址:https://clipboardjs.com/#example-text 官方github地址:https://github.com/zeno ...

  6. 【Html】Clipboard.js 实现点击复制,剪切板操作

    可以使用cdn 或者直接下载 设置好引用路径(百度云下载) <script type="text/javascript" src="./dist/clipboard ...

  7. js实现点击复制网页内容(基于clipboard.js)

    浏览网页过程中会遇到点击复制链接地址的情况,下面就介绍一种实现方法,该方法是基于clipboard.js: 官网地址:https://clipboardjs.com/: clipboard.js使用比 ...

  8. 前端技术之:如何在Vue中使用clipboard.js复制服务端数据

    第一步 创建点击对象页面元素,并绑定业务数据. <el-button type="text" size="mini" class="copy-b ...

  9. 解决clipboard.js在移动端复制失败的问题

    1.前沿 在项目中使用clipboard.js插件去实现点击按钮,复制一段网址到剪切板的功能.功能做好后,一开始无论这pc端还是移动端都能正常使用.突然某一天测出了一个bug:移动端复制失败,pc端是 ...

随机推荐

  1. 支付返回post请求数据

    点击返回商家返回的post数据: {"requestBody":"singnType=&version=&businessId=00WGFKB20012& ...

  2. Kong for Enterprise | Kong - Open-Source API and Microservice Management Layer

    Kong for Enterprise | Kong - Open-Source API and Microservice Management Layer undefined

  3. 常用shell变量$#,$@,$0,$1,$2等

    常用shell变量$#,$@,$0,$1,$2的含义解释: $$ Shell本身的PID(ProcessID) $! Shell最后运行的后台Process的PID $? 最后运行的命令的结束代码(返 ...

  4. ADO.NET对象模型

    ADO.NET建立在NetFramwork一些核心类的基础之上,可以将这些类分为两组:用于包含于管理数据的容器类与用于连接特定数据源的控制类. 容器类是通用的,无论使用什么样的数据源,都可以使用相同的 ...

  5. spring mvc 介绍

    Spring MVC Tutorial tag. * * If you do not want to deal with the intricities of the noscript * secti ...

  6. UVa10886 Standard Deviation

    留坑(p.345) 这是什么意思 暴力? 然而那些有两个人跑的那么快是为什么?(有个人竟然是陈锋...)

  7. ng-repeat 遍历同值数组导致的报错

    http://blog.csdn.net/tyust512/article/details/50370624

  8. 【Android - 进阶】之代码打包签名与混淆

    代码打包签名 Android Studio为大家集成了代码打包混淆的功能,具体操作流程如下组图所示: 1.点击Android Studio上方工具栏的  Build -> Generate Si ...

  9. Linq to XML 读取XML 备忘笔记

    本文转载:http://www.cnblogs.com/infozero/archive/2010/07/13/1776383.html Linq to XML 读取XML 备忘笔记 最近一个项目中有 ...

  10. gitlab hooks

    之前一直用文件同步工具进行两台服务器之间的同步 最初的目的是吧gitlab的代码库同步到开发环境中运行 实时的 ,后来由于gitlab的代码仓库的代码不是实时的 于是在即使同步不适合 我的需求. 后来 ...