Clipboard.js: IE8 Support

Created on 5 Oct 2015  路  13Comments  路  Source: zenorocha/clipboard.js

ClipboardAction uses addEventListener and removeEventListener methods, which are not supported in IE8.

clipboard.js already contains component-events module that can be used to resolve this issue.

question

Most helpful comment

Why support something that will be unsupported in a couple of months?

As a web developer I could not care less whether it is supported or not. The question that matters to me is "Will it still be used by a significant number of people in a couple of months?"

Extrapolating stats for last three years: sure as hell it will be.

All 13 comments

Microsoft is officially going to stop supporting IE8 on Jan 12, 2016
http://blogs.msdn.com/b/ie/archive/2014/08/07/stay-up-to-date-with-internet-explorer.aspx and the last stable release was 4 years ago.. :) I really don't see any point on supporting IE8 especially when it comes to new stuff..

My point is that it comes with no additional price: a native method call could be replaced with library method call, and the library is already there.

Also, it is not nice to leave 2% of users behind just because IE8 is not cool anymore.

Why support something that will be unsupported in a couple of months?

You can include https://cdn.polyfill.io/v2/docs/ if you want to easily support IE8

addEventListener is not the core issue. IE8 can't be supported easily because it doesn't have support for execCommand, which clipboard.js needs to function properly.

You should look into flash based alternatives if you really need to support IE8

MDN is wrong, execCommand is supported in IE8.

Even if it wasn't, it's okay, since execCommand call is wrapped in try/catch block, so I could provide a fallback.

Why support something that will be unsupported in a couple of months?

As a web developer I could not care less whether it is supported or not. The question that matters to me is "Will it still be used by a significant number of people in a couple of months?"

Extrapolating stats for last three years: sure as hell it will be.

So I fired up an IE8 VM and tested execCommand with the copy command, and it indeed worked. (with a pop up asking me for clipboard permission first)

With enough will someone could probably get it to work. If you really want it, you could pick up that task and send a pull request.

I think the bigger issue will be that getters and setters don't work in IE8, so this code will need to be refactored slightly (to use setAction and getAction methods, rather than a property).

@zenorocha If you don't mind, I'll make a PR.

Refactoring code to support a dying browser is something we should avoid.

Hey guys,

If only adding component-events would resolve this issue, then I'd be more than happy to go for it. But refactoring code to support that is the first step into a wrong path. Also Babel only supports IE9+.

Anyways, thanks @sameoldmadness for starting this conversation.

Was this page helpful?
0 / 5 - 0 ratings