首页 > 为什么github上复制链接的那个按钮用的flash?

为什么github上复制链接的那个按钮用的flash?

右边的那个复制的按钮是个flash,为什么呢?


解决浏览器兼容性问题


Ubuntu上Chromium没装flash,果断没有复制按钮。。


只是一个font icon啊


不好意思,是我自己没看清楚,是有用到flash,@llffzzk 说的对,github用的是这个插件:zeroclipboard

This library is fully compatible with Flash Player 11.0.0 and above,
which requires that the clipboard copy operation be initiated by a
user click event inside the Flash movie. This is achieved by
automatically floating the invisible movie on top of a DOM element of
your choice. Standard mouse events are even propagated out to your DOM
element, so you can still have rollover and mousedown effects with
just a little extra effort.


主要是兼容性问题吧,虽然有些浏览器提供了复制的API,但是并不通用


出于安全考虑,默认浏览器不能访问剪切板,需要开启才行,但是不是所有人都知道都会这么做,所以用了flash解决这个问题,flash可以访问

【热门文章】
【热门文章】